pat a(in C)
zjdxwwx
这个作者很懒,什么都没留下…
展开
-
1002. A+B for Polynomials (25)
#includeint main(){int num[3]={0};//记录每个多项式有多少项int exp[3][20];//存每个多项式的指数double coe[3][20];//系数,由于相加的结果最多可能有20项,因此此处数组大小是必要的int i,j,k=0;for(i=0;i0){//两个多项式都未遍历结束if(exp[0][i]>exp[1][j]){//比较谁的系数更大exp[2原创 2014-11-22 15:04:58 · 236 阅读 · 0 评论 -
1037. Magic Coupon (25)
1037. Magic Coupon (25)时间限制100 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueThe magic shop in Mars is offering some magic原创 2016-09-17 15:30:53 · 231 阅读 · 0 评论 -
1032. Sharing (25)
1032. Sharing (25)时间限制100 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueTo store English words, one method is to use linke原创 2016-08-28 16:41:44 · 368 阅读 · 0 评论 -
1029. Median (25)
1029. Median (25)时间限制1000 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven an increasing sequence S of N integers, the原创 2016-08-28 16:21:38 · 393 阅读 · 0 评论 -
1005. Spell It Right (20)
/*Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input file contains one test case. Each原创 2014-12-03 19:53:36 · 226 阅读 · 0 评论 -
1020. Tree Traversals (25)
/*-----------------------------------------------------------------------本题采用先根据后序和中序遍历的结果建树,然后再根据建好的树进行层序遍历的方法来完成-------------------------------------------------------------------------*/#include原创 2015-02-05 10:16:16 · 252 阅读 · 0 评论 -
1010. Radix (25)
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is "yes", if 6 is a decimal number and 110 is a binary number.Now for any pair of positive原创 2015-02-24 17:12:11 · 265 阅读 · 0 评论 -
1009. Product of Polynomials (25)
#includeint main(){ int i,j,k[2],count = 0; double result[2001]; int exp_t,exp[2][1001];//指数 double coe_t,coe[2][1001];//系数 for(i=0;i<2001;i++) result[i] = 0; scanf("%d",&k[0]); for(i=0;i<k[原创 2015-02-24 11:18:01 · 227 阅读 · 0 评论 -
1012. The Best Rank (25)
To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculus or Linear Algebra), and E - Eng原创 2015-02-24 23:50:14 · 275 阅读 · 0 评论 -
1086. Tree Traversals Again (25)
/*--------------------------------------------------------------------------------------------------------------------- 本题一般的想法可以根据堆栈的操作先将树建起来,然后在对树进行后序遍历,这种方法不仅思维简单,而且出错率很低, 不失为一种好的方法。 但此原创 2015-02-05 16:00:39 · 562 阅读 · 1 评论 -
1001. A+B Format (20)
Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits).InputEach input file cont原创 2014-11-22 16:04:19 · 244 阅读 · 0 评论 -
1050. String Subtraction (20)
1050. String Subtraction (20)时间限制10 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven two strings S1 and S2, S = S1 - S2原创 2016-10-03 11:46:55 · 287 阅读 · 0 评论