c++这么写哪错了?

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

PengDave @ 2023-07-26 14:05:52

#include<iostream>
#include<cstring>
using namespace std;
int main(){
    char a[6];
    cin>>a;
    for(int i=strlen(a-1);i>=0;i++){
        cout<<a[i];
    }
    return 0;
}

by AstaSunch_ @ 2023-07-26 14:07:38

i-- 不是 i++


by 哈哈人生 @ 2023-07-26 14:13:54

@AstaTab ✔没错


|