竞赛
考级
#include<iostream> using namespace std int main(){ int l; cin >> l; for(int i = 1;i <= l;i++){ int ll,lll,llll; scanf("%d+%d=%d",&ll,&lll,&llll); if(ll +lll == llll) cout << "Right!" << endl; else cout << "Wrong!" << endl; } return 0; }
梦中情AC
#include<bits/stdc++.h> using namespace std; main() { int a[1005],b[1005],c[1005],s; char g,q; cin>>s; for(int i=0;i<s;i++) { cin>>a[i]>>g>>b[i]>>q>>c[i]; } for(int i=0;i<s;i++) { if(a[i]+b[i]==c[i]) cout<<"Right!"<<endl; else cout<<"Wrong!"<<endl; } }
鬼影之魂
AC君
T=int(input()) for i in range(T): a=input().split('=') if eval(a[0])==eval(a[1]): print('Right!') else: print('Wrong!')
151****9879
#include <iostream> using namespace std; int main(){ int n; char j,d; cin >> n; int a[1005],b[1005],c[1005]; for(int i=0;i<n;i++){ cin >>a[i]>>j>>b[i]>>d>>c[i]; } for(int i=0;i<n;i++){ if(a[i]+b[i]==c[i]){ cout <<"Right!"<<endl; }else{ cout<<"Wrong!"<<endl; } } return 0; }
yhx8888
c++: #include<bits/stdc++.h> using namespace std; int main(){ int n; scanf("%d",&n); for(int i=0;i<n;i++){ int a,b,c; scanf("%d+%d=%d",&a,&b,&c); if(a+b==c)printf("Right!\n"); else printf("Wrong!\n"); } return 0; }
龙🐉
#include<bits/stdc++.h> using namespace std; int main(){ int t; scanf("%d",&t); while(t--){ int a,b,c; scanf("%d+%d=%d",&a,&b,&c); if(a+b==c)printf("Right!\n"); else printf("Wrong!\n"); } return 0; }
Simpletense
众所周知,我们用cin 导入整数时,遇到不是整数的字符则停止输入。我们可以利用这个特性。
隐姓埋名
七(6)朱瀚辰
n=int(input()) for i in range(n): a=input().split('=') if eval(a[0])==eval(a[1]): print('Right!') else: print('Wrong!')
dino
Python:n=int(input()) for i in range(n): a=input() z=a.index('+') m=a.index('=') b=az,a[z+1:m],a[m+1:] b=list(b) b=list(map(int,b)) if b[0]+b[1]==b[2]: print('Right!') else: print('Wrong!')