摘要: http://poj.org/problem?id=3916 简单的删除连续重复项 //3916 #include<stdio.h> int main(){ int N,a[25]; int i,j,k,temp; while(true){ scanf("%d",&N); if(N==0){ bre 阅读全文
posted @ 2019-10-17 20:36 智人心 阅读(92) 评论(0) 推荐(0)
摘要: http://poj.org/problem?id=3913 简单的排序 //3913 #include<stdio.h> bool Order(int a,int b,int c){ if((a<=b&&b<=c)||(a>=b&&b>=c)){ return true; } return fal 阅读全文
posted @ 2019-10-17 20:13 智人心 阅读(112) 评论(0) 推荐(0)
摘要: http://poj.org/problem?id=3917 石头剪子布,比较简单,目前没什么可说的 #include<stdio.h> #include<string.h> int main(){ char a1[80],a2[80]; char a3[3] = {'R','S','P'}; in 阅读全文
posted @ 2019-10-15 22:37 智人心 阅读(99) 评论(0) 推荐(0)
摘要: 象棋判断绝杀 参考https://blog.csdn.net/qq_34731703/article/details/54608740 同样的思路可以判断五子棋绝杀和和棋 #include<iostream> #include<cstdio> #include<algorithm> #include 阅读全文
posted @ 2019-10-14 17:45 智人心 阅读(121) 评论(0) 推荐(0)
摘要: http://poj.org/problem?id=1017 //POJ_1017 //参考https://www.cnblogs.com/MashiroSky/p/5928053.html #include<stdio.h> int max(int a,int b){ if(a>b){ retur 阅读全文
posted @ 2019-10-13 23:14 智人心 阅读(86) 评论(0) 推荐(0)
摘要: http://poj.org/problem?id=1007 题目要求按倒序数升序排列字符串,有一点要注意,输出时候要控制字符数,否则会OLE #include<stdio.h> char c[100][50]; int Step(char*a,int length){ int step = 0; 阅读全文
posted @ 2019-10-11 22:00 智人心 阅读(116) 评论(0) 推荐(0)
摘要: http://poj.org/problem?id=1006 根据题意很自然地写出了暴破解法如下: //POJ_1006 #include<stdio.h> int main(){ int n,i,j,k; int p,q,r,d; n = 0; while(true){ scanf("%d %d 阅读全文
posted @ 2019-10-11 21:59 智人心 阅读(105) 评论(0) 推荐(0)
摘要: http://poj.org/problem?id=1002 此题大意为输入一系列电话号,输出重复出现的电话号 输入:可以输入大写字母(除了Q和Z),数字或者横线(-) 字母按拼音九键的对应规则,横线为无意义输入 算法:先把输入整理为七位数字,存进b[N] 将b[N]用sort(b,b+n)排序 输 阅读全文
posted @ 2019-10-11 21:56 智人心 阅读(93) 评论(0) 推荐(0)
摘要: http://poj.org/problem?id=1003 题目要求从1/2+1/3+......+1/(n+1)大于给定的一个浮点数,输出n #include<stdio.h> int main(){ int i; double sum,c; while(true){ scanf("%lf",& 阅读全文
posted @ 2019-10-11 21:56 智人心 阅读(84) 评论(0) 推荐(0)
摘要: http://poj.org/problem?id=1000 题目要求输入两个整数,输出和 #include<stdio.h> int main(){ int a,b; scanf("%d %d",&a,&b); printf("%d\n",a+b); return 0; } 扩展:输入两个大整数, 阅读全文
posted @ 2019-10-11 21:53 智人心 阅读(71) 评论(0) 推荐(0)