| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
查点被气死,打成X了……# include "stdio.h"
# include "math.h"
int a[10];
int main()
{
int i, count;
while(scanf("%d",&a[0])!=-1)
{
for( i=1, count=0; i<=8; i++ )
scanf("%d",&a[i]);
for( i=0; i<=8; i++ )
{
if(a[i]!=0)
{
if(count) printf(" ");
if(count)
{
if(a[i]>0) printf("+ ");
else printf("- ");
}
else if(a[i]<0) printf("-");
if((a[i]!=1&&a[i]!=-1)||(i==8))
{
if(a[i]<0) printf("%d",-a[i]);
else printf("%d",a[i]);
}
if(i!=8)
{
printf("x");
if(i!=7)
printf("^%d",8-i);
}
count++;
}
}
if(count==0) printf("0");
printf("\n");
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator