1.1.1 A+B for Input-Output Practice (I)
#include<iostream>
using namespace std;
int main()
{
int a,b;
while (cin>>a>>b)
{
cout<<a+b<<endl;
}
}
1.1.2 A+B for Input-Output Practice (II)
#include<iostream>
using namespace std;
int main()
{
int a,b,tt;
cin>>tt;
for (int t=0;t<tt;t++)
{
cin>>a>>b;
cout<<a+b<<endl;
}
}
1.1.3 A+B for Input-Output Practice (III)
#include<iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
while (a!=0 || b!=0)
{
cout<<a+b<<endl;
cin>>a>>b;
}
}
1.1.4 A+B for Input-Output Practice (IV)
#include<iostream>
using namespace std;
int main()
{
int a,b,n;
cin>>n;
while (n!=0)
{
a=0;
for (int i=0;i<n;i++)
{
cin>>b;
a+=b;
}
cout<<a<<endl;
cin>>n;
}
}
1.1.5 A+B for Input-Output Practice (V)
#include<iostream>
using namespace std;
int main()
{
int a,b,n,t;
cin>>t;
for (int tt=0;tt<t;tt++)
{
cin>>n;
a=0;
for (int i=0;i<n;i++)
{
cin>>b;
a+=b;
}
cout<<a<<endl;
}
}
1.1.6 A+B for Input-Output Practice (VI)
#include<iostream>
using namespace std;
int main()
{
int a,b,n;
while(cin>>n)
{
a=0;
for (int i=0;i<n;i++)
{
cin>>b;
a+=b;
}
cout<<a<<endl;
}
}
1.1.7 A+B for Input-Output Practice (VII)
#include<iostream>
using namespace std;
int main()
{
int a,b,n;
while(cin>>a>>b)
{
cout<<a+b<<endl<<endl;
}
}
1.1.8 A+B for Input-Output Practice (VIII)
#include<iostream>
using namespace std;
int main()
{
int a,b,n,t;
cin>>t;
for (int tt=0;tt<t;tt++)
{
cin>>n;
a=0;
for (int i=0;i<n;i++)
{
cin>>b;
a+=b;
}
cout<<a<<endl;
if (tt<t-1) cout<<endl;
}
}