-
Notifications
You must be signed in to change notification settings - Fork 0
/
a1011.cpp
56 lines (44 loc) · 1.09 KB
/
a1011.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(){
int t;
cin>>t;
vector<int> sum(32);
for(int i=1;i<=t;i++){
string stra,strb,strc;
cin>>stra>>strb>>strc;
fill(sum.begin(),sum.end(),0);
cout<<"Case #"<<i<<": ";
if(stra[0]=='-'&&strb[0]=='-'){
for(vector<int>::size_type ix=0;ix<stra.size();++ix)
sum[ix]+=(stra[ix]-'0');
for(vector<int>::size_type ix=0;ix<strb.size();++ix)
sum[ix]+=(strb[ix]-'0');
if(strc[0]!='-')
cout<<"false"<<endl;
else{
for(vector<int>::size_type ix=0;ix!=sum.size()-1;++ix){
sum[ix+1]=sum[ix]/10;
sum[ix]=sum[ix]%10;
}
//string j=str;
vector<int>::size_type j=sum.size()-1;
for(string::size_type ix=0;ix!=strc.size();++ix,j--)
if(sum[j]>)
}
}else if(stra[0]=='-'){
}else if(strb[0]=='-'){
}else{
}
for(string::size_type ix=stra.size()-1;ix>=0;--ix,++j)
sum[j]+=(stra[ix]-'0');
j=0;
for(string::size_type ix=strb.size()-1;ix>=0;--ix,++j)
sum[j]+=(strb[ix]-'0');
for(vector<int>::size_type ix=0;ix!=32;++ix)
if(sum[i])
}
return 0;
}