摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1096acm常见的输入输出类型,就是一种模板,花一点点时间背下来就可以了, 1 #include<stdio.h> 2 int main() 3 { 4 int a , b , N , i , M; 5 scanf( "%d" , &M ); 6 for( int j = 0; j < M; j++ ) 7 { 8 scanf( "%d" , &N ); 9 int sum = 0;10 for( i = 0; i < N; i+
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1095acm常见的输入输出类型,就是一种模板,花一点点时间背下来就可以了,1 #include<iostream>2 using namespace std;3 int main (){4 int a,b;5 while(cin>>a>>b){6 cout<<a+b<<endl<<endl;7 }8 return 0;9 }
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1094acm常见的输入输出类型,就是一种模板,花一点点时间背下来就可以了, 1 #include<iostream> 2 #include<stdio.h> 3 using namespace std; 4 int main (){ 5 int a,n; 6 while(scanf("%d",&n)!=EOF){ 7 int sum=0; 8 for(int i=0;i<n;i++){ 9 cin>>a;10 su...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1093acm常见的输入输出类型,就是一种模板,花一点点时间背下来就可以了,#include<iostream>using namespace std;int main (){ int a,n,m; cin>>m; for(int j=0;j<m;j++){ int sum=0; cin>>n; for(int i=0;i<n;i++){ cin>>a; sum+=a; } cou...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1092acm常见的输入输出类型,就是一种模板,花一点点时间背下来就可以了, 1 #include<iostream> 2 using namespace std; 3 4 int main (){ 5 int a,n; 6 for(;;){ 7 int sum=0; 8 cin>>n; 9 if(n==0)10 break;11 for(int i=0;i<n;i++){12 cin>>a...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1091acm常见的输入输出类型,就是一种模板,花一点点时间背下来就可以了, 1 #include<iostream> 2 using namespace std; 3 int main (){ 4 int a,b; 5 while(true){ 6 cin>>a>>b; 7 if(a==0 && b==0) 8 break; 9 cout<<a+b<<endl;10 }11 return 0;12 }
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1090acm常见的输入输出类型,就是一种模板,花一点点时间背下来就可以了, 1 #include<iostream> 2 using namespace std; 3 int main (){ 4 5 int a,b,n,i=0; 6 cin>>n; 7 while(i<n){ 8 cin>>a>>b; 9 cout<<a+b<<endl;10 i++;11 }12 return 0;13 }
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1089acm常见的输入输出类型,就是一种模板,花一点点时间背下来就可以了,1 #include<iostream>2 using namespace std;3 int main (){4 int a,b;5 while(cin>>a>>b)6 cout<<a+b<<endl;7 return 0;8 }
阅读全文