#include<bits/stdc++.h>using namespace std;__int128 a,b,ans;int c;inline __int128 read(){__int128 x=0;int f=1;char c=getchar();while(!isdigit(c)) if(c=='-') f=-1,c=getchar();while(isdigit(c)) x=(x<<3)+(x<<1)+(c^48),c=getchar();return xf;}void write(__int128 x){if(x<0) putchar('-'),x=-x;if(x>9) write(x/10);putchar(x%10|'0');}int main(){while(puts("Please press the 0 and the enter key to end the game and press the 1 or 2 and press the enter key to select the mode."),scanf("%d",&c),c){srand(time(nullptr));if(c!=1&&c!=2){puts("The key which is pressed isn't the 1 or 2.");return 0;}switch(c){case 1:a=rand()%1145+1;b=rand()%1145+1;write(a);putchar('');write(b);puts("=?");cin >> ans;if(ans==a*b) puts("You are clever.");else puts("RUSB?");case 2:a=rand()%25+1;b=rand()%25+1;write(a);putchar('^');write(b);puts("=?");cin >> ans;if(ans==__int128(pow(a,b))) cout<<"You are clever.\n";else cout<<"RUSB?\n";}}return 0;}

C++ 128位整数运算游戏 - 答题问题解决

原文地址: https://www.cveoy.top/t/topic/pWCQ 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录