数据结构编程实验02
smaracoon
这个作者很懒,什么都没留下…
展开
-
POJ2000 ZOJ2345 UVA3045 Gold Coins
//2_4_1: Gold Coins 国王赏赐金币问题 POJ2000 ZOJ2345 UVA3045#include #include #include using namespace std;int main(){ int i,N,sum,day; while(scanf("%d",&N), N != 0) { day = sum = 0; for(i = 1;;i原创 2015-04-26 11:38:09 · 323 阅读 · 0 评论 -
POJ2864 UVA3470 Pascal Library
//2_4_3: Pascal Library 是否有人参加全部晚宴 POJ2864 UVA3470#include #include #include using namespace std;int main(){ int N,D,i,j,temp,flag,a[100 + 10]; while(1) { scanf("%d%d",&N,&D); if(N == 0 |原创 2015-04-26 14:23:20 · 271 阅读 · 0 评论 -
POJ1207 UVA100 The 3n+1 problem
//2_4_2: The 3n+1 problem NP问题 POJ1207 UVA100#include #include #include using namespace std;int main(){ int a,b,i,j,min,max,ans,time; while(scanf("%d %d",&a,&b) != EOF) { if(a > b) { m原创 2015-04-26 13:53:52 · 230 阅读 · 0 评论 -
UVA11000 Bee
//2_3_1: Bee 非洲雌蜂和雄蜂繁殖问题 UVA11000#include #include #include using namespace std;int main(){ unsigned a,b,t; int N,i; while(scanf("%d",&N),N != -1) { a = 0; b = 1; for(i = 0;i < N;i ++)原创 2015-04-26 11:03:16 · 224 阅读 · 0 评论 -
POJ2017 ZOJ2176 UVA3059 Speed Limit
//2_1_1: Speed Limit 里程计算 POJ2017 ZOJ2176 UVA3059#include #include #include using namespace std;int main() { int i,n,sum,time,temp,speed; while(scanf("%d",&n), n != -1) { sum = time = 0;原创 2015-04-25 19:42:59 · 285 阅读 · 0 评论 -
POJ1922 ZOJ2229 Ride to School
//2_1_2: Ride to School 骑自行车跟上同学 POJ1922 ZOJ2229#include #include #include using namespace std;const double limit = 100000000;int main(){ int i,N,time,speed; double min,sum; while(scanf("%d"原创 2015-04-25 23:00:54 · 272 阅读 · 0 评论 -
POJ1316 ZOJ1180 UVA640 Self Numbers
//2_2_1: Self Numbers 10000以内的自数 POJ1316 ZOJ1180 UVA640#include #include #include using namespace std;const int N = 10000 + 100;int sum(int n){ if(n < 10) return n; else return (n % 10) + su原创 2015-04-26 00:22:36 · 241 阅读 · 0 评论 -
POJ1281 ZOJ1371 UVA2514 MANAGER
//2_4_5: MANAGER 进程管理的模拟 POJ1281 ZOJ1371 UVA2514#include #include #include using namespace std;const int maxn = 10000 + 10;int spend[maxn],delet[maxn],queue[maxn];void quick_sort_max(int st,int原创 2015-04-27 17:14:41 · 266 阅读 · 0 评论