CY_

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

03 2014 档案

摘要:继续数论。。Problem DescriptionWhereIsHeroFrom:Zty,what are you doing ?Zty:Iwant to calculate N!......WhereIsHeroFrom:Soeasy! How big N is ?Zty:140时,输出全部为 0。。。***********************************************************/#include#includeusing namespace std;int num[42];void cal(){ num[0] = 1,num[1] = 1; for( 阅读全文
posted @ 2014-03-28 21:22 CY_ 阅读(146) 评论(0) 推荐(0)

摘要:Problem DescriptionWritea program to read in a list of integers and determine whether or not eachnumber is prime. A number, n, is prime if its only divisors are 1 and n. Forthis problem, the numbers 1 and 2 are not considered primes.InputEachinput line contains a single integer. The list of integers 阅读全文
posted @ 2014-03-28 19:29 CY_ 阅读(282) 评论(0) 推荐(0)

摘要:Counting TrianglesProblem DescriptionGiven an equilateral triangle with n thelength of its side, program to count how many triangles in it.InputThe length n (n using namespace std;int num[1000];void cal(){ num[1] = 1;int i; for(i = 2;i>n&&n) { sum = n*(n+1)*(n+2)/6; n-=1; ... 阅读全文
posted @ 2014-03-26 20:23 CY_ 阅读(265) 评论(0) 推荐(0)

摘要:转载自新浪博客,,http://blog.sina.com.cn/s/blog_71ded6bf0100tuya.html基础题:1000、1001、1004、1005、1008、1012、1013、1014、1017、1019、1021、1028、1029、1032、1037、1040、1048、1056、1058、1061、1070、1076、1089、1090、1091、1092、1093、1094、1095、1096、1097、1098、1106、1108、1157、1163、1164、1170、1194、1196、1197、1201、1202、1205、1219、1234、1235、 阅读全文
posted @ 2014-03-23 18:27 CY_ 阅读(209) 评论(0) 推荐(0)

摘要:// 代码老是粘在最上面,就把题目当做注释放在代码里了/***标题:错误票据 某涉密单位下发了某种票据,并要在年终全部收回。 每张票据有唯一的ID号。全年所有票据的ID号是连续的,但ID的开始数码是随机选定的。 因为工作人员疏忽,在录入ID号的时候发生了一处错误,造成了某个ID断号,另外一个ID重号。 你的任务是通过编程,找出断号的ID和重号的ID。 假设断号不可能发生在最大和最小号。要求程序首先输入一个整数N(N#include#include using namespace std;char str[100][10000] = {' '};int num[10... 阅读全文
posted @ 2014-03-20 15:19 CY_ 阅读(225) 评论(0) 推荐(0)

摘要:Problem DescriptionAs the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fastest all over the world ^v^). But here comes a problem, there is only one railway where all the 阅读全文
posted @ 2014-03-09 20:37 CY_ 阅读(188) 评论(0) 推荐(0)