摘要: Problem Description Given a string containing only 'A' - 'Z', we could encode it using the following method: 1. Each sub-string containing k same char 阅读全文
posted @ 2015-03-11 21:26 泡面小王子 阅读(275) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>int gcd(int a,int b);int main(){ int n,m,a,b,i,sum;//sum是最小公倍数 scanf("%d",&n); while(n--) { scanf("%d",&m); sum=1;//sum=1 for(i=1;i<= 阅读全文
posted @ 2015-03-10 18:16 泡面小王子 阅读(180) 评论(0) 推荐(0) 编辑
摘要: #include<stdlib.h>#include <stdio.h> int main () { printf("n e\n"); printf("- \n"); printf("0 1\n"); printf("1 1\n"); printf("2 2.5\n"); double t=0.5, 阅读全文
posted @ 2015-03-10 09:37 泡面小王子 阅读(125) 评论(0) 推荐(0) 编辑
摘要: #include#define maxsize 1000int main(){ char N[maxsize+1]; int i,j,sum,n; char c; i=0; while((c=getchar())!='\n') N[i++]=c; while(N[0]!='0'){ sum=0; f... 阅读全文
posted @ 2015-03-09 17:50 泡面小王子 阅读(136) 评论(0) 推荐(0) 编辑
摘要: getch()和getchar()区别:1、getch(): 所在头文件:conio.h 函数用途:从控制台读取一个字符,但不显示在屏幕上例如: char ch;或int ch; getch();或ch=getch(); 用getch();会等待你按下任意键,再继续执行下面的语句; 用c... 阅读全文
posted @ 2015-03-09 16:52 泡面小王子 阅读(6672) 评论(0) 推荐(0) 编辑
摘要: Digital RootsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 53625Accepted Submission(s): 16747Pro... 阅读全文
posted @ 2015-03-09 15:33 泡面小王子 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 这是天津大学2015考研的编程题 Problem Description Ignatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you shoul 阅读全文
posted @ 2015-03-09 12:36 泡面小王子 阅读(192) 评论(0) 推荐(0) 编辑
摘要: #include #include #includeusing namespace std;//高效判定素数bool prime(int n){ if(n==2) return true; if(n%2==0) return false; int sqrtn=(int)sqrt((double)n)... 阅读全文
posted @ 2015-03-08 22:18 泡面小王子 阅读(135) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;int main(int argc, char *argv[]){ int a,b,count,k1,k2,k3; while(cin>>a>>b) { for(count=0;a<=b;a++) { k1=a/100; k2=(a-k1*1... 阅读全文
posted @ 2015-03-08 21:52 泡面小王子 阅读(127) 评论(0) 推荐(0) 编辑
摘要: #include#includeint main(){ char str1[1001],str2[1001]; int t,i,maxlen,len1,len2,k,num=1; scanf("%d",&t); getchar(); while(t--) { int a[1001]={0},b[10... 阅读全文
posted @ 2015-03-07 21:46 泡面小王子 阅读(137) 评论(0) 推荐(0) 编辑