题目1003:A+B ---c_str(),atoi()函数的使用;remove , erase函数的使用
摘要:1 #include 2 #include 3 int sw(char *a){ 4 int i=0,c=0; 5 while(a[i]){ 6 if(a[i]>='0'&&a[i] 2 #include 3 #include 4 using namespace std; 5 int main(){ 6 //freopen("a.txt","r",stdin); 7 char inA[20]={0}; 8 char inB[20]={0}; 9 while(cin>...
阅读全文
posted @
2013-08-17 14:15
猿人谷
阅读(1185)
推荐(0) 编辑
A+B for Matrices 及 C++ transform的用法
摘要:题目大意:给定两个矩阵,矩阵的最大大小是M*N(小于等于10),矩阵元素的值的绝对值小于等于100,求矩阵相加后全0的行以及列数。 1 #include 2 using namespace std; 3 #define N 10 4 5 int main() 6 { 7 int n,m,i,j,a[N][N],b[N][N],s; 8 while(cin>>m) 9 { if(m==0) break;10 cin>>n;11 for(i=0;i>a[i][j];14 for(i=0;i>b[i][j]; 17 ...
阅读全文
posted @
2013-08-16 20:36
猿人谷
阅读(1164)
推荐(0) 编辑
Climbing Worm
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1049 1 #include <iostream> 2 using namespace std; 3 int main() 4 { 5 int n,u,d,s,t; 6 while (cin >> n >> u >> d) 7 { 8 if (n==0) 9 return 0;10 else11 {12 s=0;13 t=0;14 while ...
阅读全文
posted @
2012-12-11 16:36
猿人谷
阅读(222)
推荐(0) 编辑
Higher Math
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2393 1 #include <iostream> 2 using namespace std; 3 int main() 4 { 5 int n,a,b,c; 6 cin >> n; 7 for (int i=1;i<=n;i++) 8 { 9 cin >> a >> b >> c;10 if (a*a+b*b==c*c || a*a+c*c==b*b || b*b+c*c==a*a)11 {12 cou...
阅读全文
posted @
2012-12-11 16:35
猿人谷
阅读(393)
推荐(0) 编辑
A+B for Input-Output Practice (VIII)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1096Problem DescriptionYour task is to calculate the sum of some integers.InputInput contains an integer N in the first line, and then N lines follow. Each line starts with a integer M, and then M integers follow in the same line.OutputFor each group of inpu
阅读全文
posted @
2012-12-11 16:31
猿人谷
阅读(333)
推荐(0) 编辑
A+B for Input-Output Practice (VII)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1095Problem DescriptionYour task is to Calculate a + b.InputThe input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.OutputFor each pair of input integers a and b you should output the sum of a and
阅读全文
posted @
2012-12-11 16:29
猿人谷
阅读(586)
推荐(0) 编辑
A+B for Input-Output Practice (VI)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1094Problem DescriptionYour task is to calculate the sum of some integers.InputInput contains multiple test cases, and one case one line. Each case starts with an integer N, and then N integers follow in the same line.OutputFor each test case you should outp
阅读全文
posted @
2012-12-11 16:28
猿人谷
阅读(458)
推荐(0) 编辑
A+B for Input-Output Practice (V)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1093Problem DescriptionYour task is to calculate the sum of some integers.InputInput contains an integer N in the first line, and then N lines follow. Each line starts with a integer M, and then M integers follow in the same line.OutputFor each group of inpu
阅读全文
posted @
2012-12-11 16:27
猿人谷
阅读(426)
推荐(0) 编辑
A+B for Input-Output Practice (IV)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1092Problem DescriptionYour task is to Calculate the sum of some integers.InputInput contains multiple test cases. Each test case contains a integer N, and then N integers follow in the same line. A test case starting with 0 terminates the input and this tes
阅读全文
posted @
2012-12-11 16:25
猿人谷
阅读(336)
推荐(0) 编辑
A+B for Input-Output Practice (III)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1091Problem DescriptionYour task is to Calculate a + b.InputInput contains multiple test cases. Each test case contains a pair of integers a and b, one pair of integers per line. A test case containing 0 0 terminates the input and this test case is not to be
阅读全文
posted @
2012-12-11 16:23
猿人谷
阅读(451)
推荐(0) 编辑
A+B for Input-Output Practice (II)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1090Problem DescriptionYour task is to Calculate a + b.InputInput contains an integer N in the first line, and then N lines follow. Each line consists of a pair of integers a and b, separated by a space, one pair of integers per line.OutputFor each pair of i
阅读全文
posted @
2012-12-11 16:21
猿人谷
阅读(551)
推荐(0) 编辑
A+B for Input-Output Practice (I)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1089Problem DescriptionYour task is to Calculate a + b.Too easy?! Of course! I specially designed the problem for acm beginners.You must have found that some problems have the same titles with this one, yes, all these problems were designed for the same aim.
阅读全文
posted @
2012-12-11 16:20
猿人谷
阅读(462)
推荐(0) 编辑