zoukankan      html  css  js  c++  java
  • 2015.3.6的程序实践

    此程序实现的是200以内的随机整数的四则运算

    代码:

    #include<iostream.h>
    #include<stdlib.h>
    int main()
    {
            int i,a,b,c,k;
            for (i=0;i<=29;i++)
           {
                 a=rand()%200;
                 b=rand()%200;
                 if(b>a)
                 {
                      c=a;
                      a=b;
                      b=c;
                  }
                  k=rand()%4;
                  if(k==0)
                       cout<<a<<"+"<<b<<"="<<endl;
                  if(k==1)
                       cout<<a<<"-"<<b<<"="<<endl;
                  if(k==2)
                       cout<<a<<"*"<<b<<"="<<endl;
                  if(k==3)
                       cout<<a<<"/"<<b<<"="<<endl;
            }
            return 0;
    }

  • 相关阅读:
    安装redis
    memcached复制-repcached
    memcached一致性哈希及php客户端实现
    安装php
    安装mysql
    安装apache
    putty配色方案
    virtualbox下centos实现主宿互访
    安装memcached
    linux网络、性能相关命令
  • 原文地址:https://www.cnblogs.com/lsfh/p/4318024.html
Copyright © 2011-2022 走看看