3 solutions
-
0
Guest MOD
-
0
#include <bits/stdc++.h> #include<>cstdio //cstdio要填到<>里面,这里我输入不进去 using namespace std; int main() { int i,x,y; char ch; char s[100],str[10]; cin>>i; for(int j=1; j<=i; j++) { cin>>str; if(str[0]>='a'&&str[0]<='c') { ch=str[0]; cin>>x>>y; } else { sscanf(str,"%d",&x); cin>>y; } memset(s,0,sizeof(s)); if(ch=='a') sprintf(s,"%d+%d=%d",x,y,x+y); else if(ch=='b') sprintf(s,"%d-%d=%d",x,y,x-y); else if(ch=='c') sprintf(s,"%d*%d=%d",x,y,x*y); cout<<s<<endl<<strlen(s)<<endl; } return 0; }
Information
- ID
- 492
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 5
- Tags
- (None)
- # Submissions
- 39
- Accepted
- 17
- Uploaded By