随机数生成---加法学习工具

#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
void main()
{
    srand(time(0));
    int a = rand() % 100;
    int b = rand() % 100;
    int c = rand() % 100;
    


    cout<<a<<"+"<<b<<"+"<<c<<"="<<endl;
    int answer;
    cin>>answer;
    cout<<((answer == a + b + c) ? "right" : "wrong")<<endl;
}



你可能感兴趣的:(c,工具,include)