为什么过不了啊各位大佬。。。。。。。

P5705 【深基2.例7】数字反转

chrysalis @ 2022-10-31 00:04:52

#include<stdio.h>
#include<string.h>
int main()
{
    int i = 0;
    char arr[10] = { 0 }, ch;
    while (1)
    {
        ch = getchar();
        arr[i] = ch;
        i++;
        if (ch == '\n')
            break;
    }
    int x, y;
    x = strlen(arr);
    for (y = x-2; y >=0; y--)
    {
        printf("%c", arr[y]);
    }
    return 0;
}

by fly2024 @ 2022-11-01 20:52:36

hi,https://www.luogu.com.cn/team/47366#main 欢迎来到皇家战队, 加油!


by fly2024 @ 2022-11-01 20:56:39

#include <bits/stdc++.h>
using namespace std;

char str[100];

int main() {
scanf("%s",str + 1);
int len = strlen(str + 1);
for(int i=len;i>=1;i--) {
printf("%c",str[i]);
}
return 0;
}

|