9 条题解
-
1
202502cj14周子祥 (周子祥) LV 8 @ 2025-03-30 17:51:36
#include<stdio.h>
using namespace std;
int main(){
int n, a;
scanf("%d", &n);
if(n == 1)goto p;
scanf("%d", &a);
if(a){
if(a == 1)printf("x^%d", n);
else if(a == -1)printf("-x^%d", n);
else printf("%dx^%d", a, n);
}
if(n == 2)goto p;
for(int i = n-1; i > 1; i--){
scanf("%d", &a);
if(a){
if(a == 1)printf("+x^%d", i);
else if(a == -1)printf("-x^%d", i);
else printf("%+dx^%d", a, i);
}
}
p:
scanf("%d", &a);
if(a){
if(a == 1)printf("+x");
else if(a == -1)printf("-x");
else if(n != 1)printf("%+dx", a);
else printf("%dx", a);
}
scanf("%d", &a);
if(a)printf("%+d", a);
return 0;
} -
12025-03-30 17:51:31@
#include<stdio.h>
using namespace std;
int main(){
int n, a;
scanf("%d", &n);
if(n == 1)goto p;
scanf("%d", &a);
if(a){
if(a == 1)printf("x^%d", n);
else if(a == -1)printf("-x^%d", n);
else printf("%dx^%d", a, n);
}
if(n == 2)goto p;
for(int i = n-1; i > 1; i--){
scanf("%d", &a);
if(a){
if(a == 1)printf("+x^%d", i);
else if(a == -1)printf("-x^%d", i);
else printf("%+dx^%d", a, i);
}
}
p:
scanf("%d", &a);
if(a){
if(a == 1)printf("+x");
else if(a == -1)printf("-x");
else if(n != 1)printf("%+dx", a);
else printf("%dx", a);
}
scanf("%d", &a);
if(a)printf("%+d", a);
return 0;
} -
12025-03-30 17:51:27@
#include<stdio.h>
using namespace std;
int main(){
int n, a;
scanf("%d", &n);
if(n == 1)goto p;
scanf("%d", &a);
if(a){
if(a == 1)printf("x^%d", n);
else if(a == -1)printf("-x^%d", n);
else printf("%dx^%d", a, n);
}
if(n == 2)goto p;
for(int i = n-1; i > 1; i--){
scanf("%d", &a);
if(a){
if(a == 1)printf("+x^%d", i);
else if(a == -1)printf("-x^%d", i);
else printf("%+dx^%d", a, i);
}
}
p:
scanf("%d", &a);
if(a){
if(a == 1)printf("+x");
else if(a == -1)printf("-x");
else if(n != 1)printf("%+dx", a);
else printf("%dx", a);
}
scanf("%d", &a);
if(a)printf("%+d", a);
return 0;
} -
12025-03-30 17:51:23@
#include<stdio.h>
using namespace std;
int main(){
int n, a;
scanf("%d", &n);
if(n == 1)goto p;
scanf("%d", &a);
if(a){
if(a == 1)printf("x^%d", n);
else if(a == -1)printf("-x^%d", n);
else printf("%dx^%d", a, n);
}
if(n == 2)goto p;
for(int i = n-1; i > 1; i--){
scanf("%d", &a);
if(a){
if(a == 1)printf("+x^%d", i);
else if(a == -1)printf("-x^%d", i);
else printf("%+dx^%d", a, i);
}
}
p:
scanf("%d", &a);
if(a){
if(a == 1)printf("+x");
else if(a == -1)printf("-x");
else if(n != 1)printf("%+dx", a);
else printf("%dx", a);
}
scanf("%d", &a);
if(a)printf("%+d", a);
return 0;
} -
12025-03-30 17:51:17@
#include<stdio.h>
using namespace std;
int main(){
int n, a;
scanf("%d", &n);
if(n == 1)goto p;
scanf("%d", &a);
if(a){
if(a == 1)printf("x^%d", n);
else if(a == -1)printf("-x^%d", n);
else printf("%dx^%d", a, n);
}
if(n == 2)goto p;
for(int i = n-1; i > 1; i--){
scanf("%d", &a);
if(a){
if(a == 1)printf("+x^%d", i);
else if(a == -1)printf("-x^%d", i);
else printf("%+dx^%d", a, i);
}
}
p:
scanf("%d", &a);
if(a){
if(a == 1)printf("+x");
else if(a == -1)printf("-x");
else if(n != 1)printf("%+dx", a);
else printf("%dx", a);
}
scanf("%d", &a);
if(a)printf("%+d", a);
return 0;
} -
12025-03-30 17:51:10@
#include<stdio.h>
using namespace std;
int main(){
int n, a;
scanf("%d", &n);
if(n == 1)goto p;
scanf("%d", &a);
if(a){
if(a == 1)printf("x^%d", n);
else if(a == -1)printf("-x^%d", n);
else printf("%dx^%d", a, n);
}
if(n == 2)goto p;
for(int i = n-1; i > 1; i--){
scanf("%d", &a);
if(a){
if(a == 1)printf("+x^%d", i);
else if(a == -1)printf("-x^%d", i);
else printf("%+dx^%d", a, i);
}
}
p:
scanf("%d", &a);
if(a){
if(a == 1)printf("+x");
else if(a == -1)printf("-x");
else if(n != 1)printf("%+dx", a);
else printf("%dx", a);
}
scanf("%d", &a);
if(a)printf("%+d", a);
return 0;
} -
12025-03-30 17:51:02@
#include<stdio.h>
using namespace std;
int main(){
int n, a;
scanf("%d", &n);
if(n == 1)goto p;
scanf("%d", &a);
if(a){
if(a == 1)printf("x^%d", n);
else if(a == -1)printf("-x^%d", n);
else printf("%dx^%d", a, n);
}
if(n == 2)goto p;
for(int i = n-1; i > 1; i--){
scanf("%d", &a);
if(a){
if(a == 1)printf("+x^%d", i);
else if(a == -1)printf("-x^%d", i);
else printf("%+dx^%d", a, i);
}
}
p:
scanf("%d", &a);
if(a){
if(a == 1)printf("+x");
else if(a == -1)printf("-x");
else if(n != 1)printf("%+dx", a);
else printf("%dx", a);
}
scanf("%d", &a);
if(a)printf("%+d", a);
return 0;
} -
12025-03-30 17:50:58@
#include<stdio.h>
using namespace std;
int main(){
int n, a;
scanf("%d", &n);
if(n == 1)goto p;
scanf("%d", &a);
if(a){
if(a == 1)printf("x^%d", n);
else if(a == -1)printf("-x^%d", n);
else printf("%dx^%d", a, n);
}
if(n == 2)goto p;
for(int i = n-1; i > 1; i--){
scanf("%d", &a);
if(a){
if(a == 1)printf("+x^%d", i);
else if(a == -1)printf("-x^%d", i);
else printf("%+dx^%d", a, i);
}
}
p:
scanf("%d", &a);
if(a){
if(a == 1)printf("+x");
else if(a == -1)printf("-x");
else if(n != 1)printf("%+dx", a);
else printf("%dx", a);
}
scanf("%d", &a);
if(a)printf("%+d", a);
return 0;
} -
-12024-09-01 13:57:10@
#include<stdio.h> using namespace std; int main(){ int n, a; scanf("%d", &n); if(n == 1)goto p; scanf("%d", &a); if(a){ if(a == 1)printf("x^%d", n); else if(a == -1)printf("-x^%d", n); else printf("%dx^%d", a, n); } if(n == 2)goto p; for(int i = n-1; i > 1; i--){ scanf("%d", &a); if(a){ if(a == 1)printf("+x^%d", i); else if(a == -1)printf("-x^%d", i); else printf("%+dx^%d", a, i); } } p: scanf("%d", &a); if(a){ if(a == 1)printf("+x"); else if(a == -1)printf("-x"); else if(n != 1)printf("%+dx", a); else printf("%dx", a); } scanf("%d", &a); if(a)printf("%+d", a); return 0; }
- 1
信息
- ID
- 1460
- 难度
- 6
- 分类
- (无)
- 标签
- 递交数
- 42
- 已通过
- 12
- 通过率
- 29%
- 上传者