摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1281这题是判断前一个字符串能否在后一个字符串中按顺序找出来,并不一定要连续,但要按顺序,并全部找到,可以将二者一一对应,如果前一个字符串能全部按顺序对应,就可以,否则不行View Code 1 #include<stdio.h> 2 #include<string.h> 3 char s[1000010],t[1000010 阅读全文
posted @ 2013-02-19 09:37 执着追求的IT小小鸟 阅读(116) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1287彼得的烟抽完剩下烟头,输入香烟n和k个烟头可以卷成一根新的香烟,然后求总的可以抽的香烟数,只要循环到最后的烟头数小于k就可以了View Code 1 #include<stdio.h> 2 int main() 3 { 4 int n,k,yt,yl; 5 while(scanf("%d%d",&n,&a 阅读全文
posted @ 2013-02-19 09:29 执着追求的IT小小鸟 阅读(115) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1361这题是关于旅游点的名胜清单,输入国家名和景点,计算各个国家的景点数,保留不重复的,重复的就在原来的基础上加上一,最后输出时注意按字典序输出#include<stdio.h>#include<string.h>struct country{ char name[100]; int sum; };/... 阅读全文
posted @ 2013-02-19 09:24 执着追求的IT小小鸟 阅读(123) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1365爱的计算,把两个人的名字中的各个字母分别对应1到26,并相加,分别记和,最后二人和的比就是爱的结果,注意这个结果不超过100%View Code 1 #include<stdio.h> 2 #include<string.h> 3 void zhuanhua(char *s)//把大写改成小写 4 { 5 while(* 阅读全文
posted @ 2013-02-19 09:20 执着追求的IT小小鸟 阅读(126) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1637根据题意给出的公式,运用递归函数,求出结果View Code 1 #include<stdio.h> 2 int f91(int n) 3 { 4 if(n<=100) 5 return f91(f91(n+11)); 6 else if(n>=101) 7 return n-10;//自定义递归函数 8 } 9 int 阅读全文
posted @ 2013-02-18 16:59 执着追求的IT小小鸟 阅读(56) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1724将两数之间的所有奇数加起来,得到结果View Code 1 #include<stdio.h> 2 int main() 3 { 4 int a,b,sum,i,n; 5 scanf("%d",&n); 6 for(i=1;i<=n;i++) 7 { 8 sum=0;//和要先初始化 9 scanf 阅读全文
posted @ 2013-02-18 16:58 执着追求的IT小小鸟 阅读(52) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1862根据题目给的数字符号字母组合,数字和符号不变,将字母与相应的数字进行转换,输出电话号码View Code 1 #include<stdio.h> 2 #include<string.h> 3 int main() 4 { 5 int a,i; 6 char str[50]; 7 while(scanf("%s& 阅读全文
posted @ 2013-02-18 16:56 执着追求的IT小小鸟 阅读(114) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1865把题目给出的字母所对应的值加起来,再判断是否是prime number 即素数 1 #include<stdio.h> 2 #include<math.h> 3 int main()//把字母所对应的值加起来,再判断是否是prime number 即素数 4 { 5 int a,i,flag; 6 char str[50 阅读全文
posted @ 2013-02-18 16:53 执着追求的IT小小鸟 阅读(65) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/external/104/10469.html这道题目中的计算方法其实就是位运算中的异或计算View Code 1 #include<stdio.h>2 #include<stdlib.h>3 int main()4 {5 int a,b;6 while(scanf("%d%d",&a,&b)!=EOF)7 printf("%d\n",a^b); // "Mofiz way"其实就是异或的运算方法8 return 0;9 } 阅读全文
posted @ 2013-02-18 16:43 执着追求的IT小小鸟 阅读(63) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=949输入几个句子,然后求出每个字母所出现的次数,按格式输出View Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<conio.h> 4 void zhuanhua(char *s)//把小写字母转化为大写字母 5 { 6 int i; 7 for( 阅读全文
posted @ 2013-02-18 16:36 执着追求的IT小小鸟 阅读(143) 评论(0) 推荐(0) 编辑