cjweffort

博客园 首页 联系 订阅 管理
上一页 1 ··· 9 10 11 12 13 14 下一页

2013年3月2日

摘要: http://ac.jobdu.com/problem.php?cid=1040&pid=19题目描述:输入数组长度 n输入数组 a[1...n]输入查找个数m输入查找数字b[1...m]输出 YES or NO 查找有则YES 否则NO 。输入:输入有多组数据。每组输入n,然后输入n个整数,再输入m,然后再输入m个整数(1 #include using namespace std; const int N=103; int a[N]; int binarySearch(int num, int low, int high) { if(low>high) return -1; i 阅读全文
posted @ 2013-03-02 12:08 cjweffort 阅读(164) 评论(0) 推荐(0) 编辑

摘要: http://ac.jobdu.com/problem.php?cid=1040&pid=17题目描述:输入N个学生的信息,然后进行查询。输入:输入的第一行为N,即学生的个数(N #include #include using namespace std; const int N=1003; typedef struct STU { char no[8]; char name[100],sex[6]; int age; }STU; STU stu[N]; bool cmp(STU m1, STU m2) { return strcmp(m1.no,m2.no)high) r... 阅读全文
posted @ 2013-03-02 12:08 cjweffort 阅读(160) 评论(0) 推荐(0) 编辑

摘要: http://ac.jobdu.com/problem.php?cid=1040&pid=15题目描述:Harmony is indispensible in our daily life and no one can live without it----may be Facer is the only exception. One day it is rumored that repeat painting will create harmony and then hundreds of people started their endless drawing. Their pai 阅读全文
posted @ 2013-03-02 12:07 cjweffort 阅读(193) 评论(0) 推荐(0) 编辑

摘要: http://ac.jobdu.com/problem.php?cid=1040&pid=14题目描述:把一个个大小差一圈的筐叠上去,使得从上往下看时,边筐花色交错。这个工作现在要让计算机来完成,得看你的了。输入:输入是一个个的三元组,分别是,外筐尺寸n(n为满足0 #include const int N=81; bool tag[N][N]; int main() { freopen("F:\\test.txt","r",stdin); freopen("F:\\output.txt","w",stdo 阅读全文
posted @ 2013-03-02 12:07 cjweffort 阅读(186) 评论(0) 推荐(0) 编辑

摘要: http://ac.jobdu.com/problem.php?cid=1040&pid=13题目描述:输入一个高度h,输出一个高为h,上底边为h的梯形。输入:一个整数h(1 #include int main() { int n; while(scanf("%d",&n)!=EOF) { int count=n+2*(n-1); for(int i=1;i<=n;i++) { int tmp=count-(n+2*(i-1)); for(int j=1;j<=tmp;j++) printf(" "); for(int j=t 阅读全文
posted @ 2013-03-02 12:06 cjweffort 阅读(178) 评论(0) 推荐(0) 编辑

摘要: http://ac.jobdu.com/problem.php?cid=1040&pid=16题目描述:输入一个数n,然后输入n个数值各不相同,再输入一个值x,输出这个值在这个数组中的下标(从0开始,若不在数组中则输出-1)。输入:测试数据有多组,输入n(1 using namespace std; const int N=203; int a[N]; int main() { int n; while(cin>>n) { for(int i=0;i>a[i]; int tmp; cin>>tmp; bool flag=true; for(int i=0; 阅读全文
posted @ 2013-03-02 12:06 cjweffort 阅读(178) 评论(0) 推荐(0) 编辑

摘要: http://ac.jobdu.com/problem.php?cid=1040&pid=11题目描述: “臭味相投”——这是我们描述朋友时喜欢用的词汇。两个人是朋友通常意味着他们存在着许多共同的兴趣。然而作为一个宅男,你发现自己与他人相互了解的机会并不太多。幸运的是,你意外得到了一份北大图书馆的图书借阅记录,于是你挑灯熬夜地编程,想从中发现潜在的朋友。 首先你对借阅记录进行了一番整理,把N个读者依次编号为1,2,…,N,把M本书依次编号为1,2,…,M。同时,按照“臭味相投”的原则,和你喜欢读同一本书的人,就是你的潜在朋友。你现在的任务是从这份借阅记录中计算出每个人有几个潜在朋友。输 阅读全文
posted @ 2013-03-02 12:06 cjweffort 阅读(213) 评论(0) 推荐(0) 编辑

摘要: http://ac.jobdu.com/problem.php?cid=1040&pid=10题目描述:给你n个整数,请按从大到小的顺序输出其中前m大的数。输入:每组测试数据有两行,第一行有两个数n,m(0 #include #include #include #include #include #include #include #include #include #include using namespace std; const int N=1000003; bool hashTable[N]; #define more 500000 int main() { ... 阅读全文
posted @ 2013-03-02 11:37 cjweffort 阅读(124) 评论(0) 推荐(0) 编辑

摘要: http://ac.jobdu.com/problem.php?cid=1040&pid=12题目描述: 有一个长度为整数L(1 #include #include #include #include #include #include #include #include #include #include using namespace std; const int N=10003; int hashTable[N]; int main() { //freopen("F:\\test.txt","r",stdin); //freopen(&qu 阅读全文
posted @ 2013-03-02 11:37 cjweffort 阅读(186) 评论(0) 推荐(0) 编辑

摘要: http://ac.jobdu.com/problem.php?cid=1040&pid=9题目描述:读入N名学生的成绩,将获得某一给定分数的学生人数输出。输入:测试输入包含若干测试用例,每个测试用例的格式为第1行:N第2行:N名学生的成绩,相邻两数字用一个空格间隔。第3行:给定分数当读到N=0时输入结束。其中N不超过1000,成绩分数为(包含)0到100之间的一个整数。输出:对每个测试用例,将获得给定分数的学生人数输出。样例输入:3 80 60 90 60 2 85 66 0 5 60 75 90 55 75 75 0样例输出:1 0 2// 题目10:统计同成绩学生人数.cpp: 阅读全文
posted @ 2013-03-02 11:31 cjweffort 阅读(216) 评论(0) 推荐(0) 编辑

上一页 1 ··· 9 10 11 12 13 14 下一页