求助大神

P1067 [NOIP2009 普及组] 多项式输出

只是猜测..会不会是“^”被当成按位异或了?试试分开输出?
by ouuan @ 2018-07-31 11:49:42


@[ouuan](/space/show?uid=49742) 不好意思改了一下之后还是0分,不过谢谢你的帮助。
by 黑猫_琉璃 @ 2018-07-31 12:19:53


你试一试把类似于"%c",'-'这样的都直接改成"-"
by ouuan @ 2018-07-31 13:23:30


@[黑猫_琉璃](/space/show?uid=83985) 你会写这样的代码吗#滑稽# ``` printf("%c%c%c%c%c%c%c%c%c%c%c%c",'H','e','l','l','o',',','w','o','r','l','d','!'); ```
by ouuan @ 2018-07-31 13:26:33


```cpp #include<iostream> #include<cstdlib> using namespace std; int main(){ int n,x; cin>>n; for(int i=n;i>=0;i--){ cin>>x; if(x!=0){ if(i==n){ if(x<0){ cout<<'-'; } }else{ if(x>0){ cout<<'+'; }else{ cout<<'-'; } } if(i==0){ cout<<abs(x); }else if(abs(x)==1){ cout<<'x'; }else{ cout<<abs(x)<<'x'; } if(i!=0&&i!=1){ cout<<'^'<<i; } } } } ```
by Free_S @ 2018-07-31 15:09:59


<stdlib.h>库
by Free_S @ 2018-07-31 15:10:32


@[Go_Helloworld](/space/show?uid=110781) 十分感谢,这道题我已经AC了。不过还说有一个问题:请问<stdlib.h>库是什么啊?为什么我加上这个以后就从0分变成100分了?
by 黑猫_琉璃 @ 2018-07-31 18:09:24


@[黑猫_琉璃](/space/show?uid=83985) ans()一定要用<stdlib.h>(<cstdlib>)库,你可以百度查一下。
by Free_S @ 2018-07-31 18:50:20


|