| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 165101 | 陈开远 | 【一维数组】数组元素移动(1) | C++ | Wrong Answer | 0 MS | 272 KB | 714 | 2026-11-09 20:26:34 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() int main(void) { int i,j; long int m, n; int count; int isPrime,flag; isPrime = 1; flag = 0; scanf("%ld",&n); printf("%ld=",n); m = sqrt(n); for(i = 2; i <= m;i++){ if(n%i == 0){ isPrime = 0; count = 1; n = n / i; while(n%i == 0){ n = n / i; count++; } if(flag) printf("*"); else flag = 1; if(count == 1) printf("%d",i); else printf("%d*%d",i,count); } } if(isPrime) printf("%d",n); return 0; }
------Input------
5 -1 -2 -3 -4 -5
------Answer-----
-5 -1 -2 -3 -4
------Your output-----
5=5