摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=2084View Code 1 #include<stdio.h> 2 int main() 3 { 4 int C, n, i, j ; 5 int a[110][110], dp[110][110] ; 6 scanf("%d", &C) ; 7 while(C--) 8 { 9 scanf("%d", &n) ;10 for(i=1; i<=n; i++)11 for(j=1; j<=i; j++)12 ... 阅读全文
摘要:
http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=1468&cid=1142View Code 1 #include<stdio.h> 2 #define N 1000100 3 int a[N] ; 4 int main() 5 { 6 int i, j, count, n ; 7 while(scanf("%d", &n), n!=0) 8 { 9 a[0] = a[1] = 1 ; 10 count = 0 ; 11 for(i... 阅读全文
摘要:
http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=1469&cid=1142View Code 1 #include<stdio.h> 2 #include<math.h> 3 int isprime(long n) 4 { 5 long i,k; 6 k=sqrt(n); 7 for(i=2;i<=k;i++) 8 { 9 if(n%i==0) 10 return 0; 11 } 12 return 1; 13 } 1... 阅读全文
摘要:
http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=1470&cid=1142View Code 1 #include<stdio.h> 2 int main() 3 { 4 int a, b, c, d, e, x, y; 5 int ming, maxg; 6 while(scanf("%d %d %d %d %d", &a, &b, &c, &d, &e)) 7 { 8 if(a==0&&b==0&&c==0&&d 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=2673View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 int cmp(const void *a, const void *b) 4 { 5 return *(int*)a - *(int*)b ; 6 } 7 int main() 8 { 9 int n, i, j, a[10010];10 while(scanf("%d", &n)!=EOF)11 {12 for(i=0; i<n; i++ 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1040View Code 1 #include<stdio.h> 2 int r[10000] ; 3 int QuickSort1 (int r[], int low, int high) 4 { 5 int key; 6 key=r[low]; 7 while(low<high) 8 { 9 10 while(low<high && r[high]>=key) high--;11 r[low]=r[high];12 ... 阅读全文
摘要:
http://www.cnblogs.com/morewindows/category/314533.html 阅读全文
摘要:
http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=1568&cid=1130View Code 1 #include<stdio.h> 2 #include<string.h> 3 int main() 4 { 5 char s[30][30]; 6 int h, w, i, j, count = 0, sum[30] = {0}; 7 scanf("%d %d%*c",&h, &w); 8 for(i=0; i < h; i++) 9 gets(s[i]) ;10 fo 阅读全文
摘要:
http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2085View Code 1 #include<stdio.h> 2 #include<string.h> 3 int main() 4 { 5 char str[300] ; 6 int i, j,k, t, n,iq, len ; 7 scanf("%d", &t); 8 getchar() ; 9 for(iq=0; iq<t; iq++)10 {11 gets(str);12 . 阅读全文
摘要:
http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=2550&cid=1130View Code 1 #include<stdio.h> 2 #include<string.h> 3 int main() 4 { 5 int i, n; 6 char str[1001]; 7 while (gets(str)) 8 { 9 n= strlen(str) ; 10 if(str[0]>='a' && str[0]<='z') 11 str[0] ... 阅读全文