-
个人简介
#include <bits/stdc++.h> using namespace std; int main() { int a,b,n,k,c; char op; cout<<"出题的数据范围是什么"<<endl; cout<<"出几道题"<<endl; cin>>k; cin>>n; srand(time(0)); for(int i=1;i<=n;i++) { a=rand()%k; b=rand()%k; c=rand()%4; if(c0) op='+'; else if(c1) op='-'; else if(c2) op='*'; else if(c3) op='/'; if(op=='-') { if(a<b) { cout<<b<<op<<a<<"="<<endl; } else { cout<<a<<op<<b<<"="<<endl; } } else if(op=='/') { if(a>=b&&b!=0&&a%b0) { cout<<a<<"÷"<<b<<"="<<endl; } else if(a<b&&a!=0&&b%a0) { cout<<b<<"÷"<<a<<"="<<endl; } } else cout<<a<<op<<b<<"="<<endl; } return 0; }
-
通过的题目
-
最近活动
题目标签
- 一本通编程启蒙
- 104