03 2015 档案

杭电1097-A hard puzzle
摘要:Problem Description lcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how to know the a^b.everybody objects to this BT prob 阅读全文

posted @ 2015-03-12 22:50 泡面小王子 阅读(240) 评论(0) 推荐(0)

杭电1020-Encoding
摘要: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 泡面小王子 阅读(279) 评论(0) 推荐(0)

杭电1019-Least Common Multiple
摘要:#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 泡面小王子 阅读(185) 评论(0) 推荐(0)

杭电1012-u Calculate e
摘要:#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 泡面小王子 阅读(134) 评论(0) 推荐(0)

杭电1013-Digitai Root(另解)
摘要:#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 泡面小王子 阅读(141) 评论(0) 推荐(0)

gets()和getchar()还有getch()的区别
摘要:getch()和getchar()区别:1、getch(): 所在头文件:conio.h 函数用途:从控制台读取一个字符,但不显示在屏幕上例如: char ch;或int ch; getch();或ch=getch(); 用getch();会等待你按下任意键,再继续执行下面的语句; 用c... 阅读全文

posted @ 2015-03-09 16:52 泡面小王子 阅读(6792) 评论(0) 推荐(0)

杭电1013-Digitai Root(这是一道考研编程题-天大2015)
摘要: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 泡面小王子 阅读(206) 评论(0) 推荐(0)

杭电1062-字符串翻转
摘要:这是天津大学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 泡面小王子 阅读(210) 评论(0) 推荐(0)

杭电2012-素数判定
摘要:#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 泡面小王子 阅读(142) 评论(0) 推荐(0)

杭电2010-水仙花
摘要:#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 泡面小王子 阅读(131) 评论(0) 推荐(0)

杭电1002-A + B Problem II
摘要:#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 泡面小王子 阅读(146) 评论(0) 推荐(0)

九度-题目1011:最大连续子序列
摘要:题目描述: 给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ..., Nj },其中 1 #include using namespace std;int main(){ int a[10005]; int count,i,j; int st... 阅读全文

posted @ 2015-03-05 18:36 泡面小王子 阅读(321) 评论(0) 推荐(0)

杭电1003-Max Sum
摘要:Max SumProblem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,... 阅读全文

posted @ 2015-03-05 17:11 泡面小王子 阅读(320) 评论(0) 推荐(0)

杭电1071-The area
摘要:问题描述:Ignatius bought a land last week, but he didn't know the area of the land because the land is enclosed by a parabola and a straight line. The pic... 阅读全文

posted @ 2015-03-04 16:17 泡面小王子 阅读(225) 评论(0) 推荐(0)

杭电1005-Number Sequence
摘要:问题描述A number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calculate the... 阅读全文

posted @ 2015-03-04 10:45 泡面小王子 阅读(288) 评论(0) 推荐(0)

杭电1021
摘要:观察数列中每项除3的余数,分别是1,2,0,2,2,1,0,1,1,2,0.用数学归纳法可以证出这个规律(在此略过)发现每八项出现一次循环所以n满足n=8k+2或n=8k-2 (k是自然数) #include #include using namespace std; int main()... 阅读全文

posted @ 2015-03-03 22:08 泡面小王子 阅读(174) 评论(0) 推荐(0)