ZZULI Greedy Gift Givers Greedy…
来源:互联网 发布:淘宝魔镜数据 编辑:程序博客网 时间:2024/04/28 03:14
还是那个IMPORTANTNOTE惹的祸!把个gets()改为scanf就行了
#include<stdio.h>#include<string.h>#include<stdlib.h>struct fen{ int money; char name[20];}fen[20];int main(){ int m,i,d,q,j,s; char a[20]; scanf("%d",&m); for(i=0;i<19;i++) fen[i].money=0; for(i=0;i<m;i++) scanf("%s",fen[i].name); for(q=0;q<m;q++) { scanf("%s",a); scanf("%d%d",&s,&d); if(d==0)continue; for(i=0;i<m;i++) if(strcmp(fen[i].name,a)==0) { // puts(fen[i].name); fen[i].money+=s%d-s;//printf("%d\n",fen[i].money); break; } for(i=0;i<d;i++) { scanf("%s",a); for(j=0;j<m;j++) if(strcmp(fen[j].name,a)==0) { // printf("%d\n",fen[j].money); fen[j].money+=s/d;//printf("%d\n",fen[j].money); break; } } } for(i=0;i<m;i++) printf("%s %d\n",fen[i].name,fen[i].money); return 0;}
- ZZULI Greedy Gift Givers Greedy…
- ZZULI 1615 easy or puzzle ?(字…
-  
- ZZULI 1498 做梦!
- ZZULI 等差数列 解题报告
- ZZULI 1497 Reading Books
-
- ZZULI 1595 Pills
- 集线器 交换机 路由器 网桥 …
- HDU 3123(ZZULI 1605) GCC(递推) …
- ZZULI 1619 (HDU 2647) Reward …
- 使用BBED修改SCN …
- ZZULI 1210 二叉树(3)
- Hive安装 …
- android o…
- android …
- [转] 彼尔…
- “constructors not allowed …
- HDU:1287 破译密码
- HDU:1060 Leftmost Digit
- HDU 1030 Delta-wave
- hdu 1466 计算直线的交点数 第四专…
- NOIP 1199 合并果子终于做出来了…
- ZZULI Greedy Gift Givers Greedy…
- 杭电46道DP牛人总结
- 《奥巴马就本拉登死亡演讲》
- 爆:本拉登早年与苏军作战照…
- POJ:1928 花生问题 The Peanuts
- NOIP 2007 普及组解题报告--…
- 杭电题目分类
- HDU:田忌赛马(1052)
- hdu 1023,catalan,卡特兰数