上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页

2016年2月16日

摘要: 数据非常小,直接枚举即可! #include<cstdio> int a[30]; int main(){ int n=1; scanf("%d",&a[n]); while (a[n]!=0){ n++; scanf("%d",&a[n]); } n=n-1; int sum=0; for (in 阅读全文
posted @ 2016-02-16 14:08 noip之路 阅读(481) 评论(0) 推荐(0) 编辑
 
摘要: 最朴素的方法: #include<cstdio> int main(){ int a,maxn=-1,minn=32769; scanf("%d",&a); if (a%2==0) maxn=a/2; if (a%4==0) minn=a/4; for (int t=1;t<=a/4;t++) fo 阅读全文
posted @ 2016-02-16 13:27 noip之路 阅读(656) 评论(0) 推荐(0) 编辑
 
摘要: 简单枚举 数据范围: (0 <= n <= 100) 所以不需要加任何优化 #include<iostream> #include<cstdio> int main(){ int maxh=-100,a1,a2,a3,n; scanf("%d",&n); for (int i=n;i>=0;i--) 阅读全文
posted @ 2016-02-16 12:15 noip之路 阅读(533) 评论(0) 推荐(0) 编辑
 

2016年1月21日

摘要: 分析:一、赢输平三种情况0表示“石头”,2表示“剪刀”,5表示“布赢t:0-2=-22-5=-35-0=5输t:2-0=25-2=30-5=-5平t:两边的值相等二、计算出拳情况,然后一一对比对于测试数据,猜拳过程为:A:0 2 5 0 2 5 0 2 5 0B:0 5 0 2 0 5 0 2 0 ... 阅读全文
posted @ 2016-01-21 15:17 noip之路 阅读(746) 评论(0) 推荐(0) 编辑
 

2016年1月20日

摘要: c++中的243、251、250错误,原因可能是不小心输入了中文符号。 阅读全文
posted @ 2016-01-20 10:24 noip之路 阅读(647) 评论(0) 推荐(0) 编辑
 
摘要: 温馨提示:如何输出%?即两个%连写代表%,尝试输出printf(“%%”)方法1:先存储数据再处理,定义4个变量记录4个年龄段的人数,初值为0#includeint a[110];int main(){ int n; scanf("%d",&n); int temp; for... 阅读全文
posted @ 2016-01-20 09:25 noip之路 阅读(1626) 评论(0) 推荐(0) 编辑
 

2016年1月7日

摘要: 描述津津的零花钱一直都是自己管理。每个月的月初妈妈给津津300元钱,津津会预算这个月的花销,并且总能做到实际花销和预算的相同。为了让津津学习如何储蓄,妈妈提出,津津可以随时把整百的钱存在她那里,到了年末她会加上20%还给津津。因此津津制定了一个储蓄计划:每个月的月初,在得到妈妈给的零花钱后,如果她预... 阅读全文
posted @ 2016-01-07 19:39 noip之路 阅读(529) 评论(0) 推荐(0) 编辑
 
摘要: 描述输出一个整数序列中与指定数字相同的数的个数。输入输入包含三行: 第一行为N,表示整数序列的长度(N int main(){ int n,m; int a[110]; scanf("%d",&n); for (int i=1;i<=n;i++) scanf("... 阅读全文
posted @ 2016-01-07 18:56 noip之路 阅读(1489) 评论(0) 推荐(0) 编辑
 

2015年12月31日

摘要: 05:整数序列的元素最大跨度值总时间限制:1000ms内存限制:65536kB描述给定一个长度为n的非负整数序列,请计算序列的最大跨度值(最大跨度值 = 最大值减去最小值)。 输入一共2行,第一行为序列的个数n(1 int main(){ int sum=0,n,x,min=10000,max... 阅读全文
posted @ 2015-12-31 16:05 noip之路 阅读(1464) 评论(0) 推荐(0) 编辑
 
摘要: 总时间限制:1000ms内存限制:65536kB描述读入n(1 int main(){ int sum=0,n,x; scanf("%d",&n); for (int i=1;i<=n;i++){ scanf("%d",&x); sum=sum+x; ... 阅读全文
posted @ 2015-12-31 15:30 noip之路 阅读(556) 评论(0) 推荐(0) 编辑
 
上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页