首页 > 试题广场 >

#include using names...

[填空题]
#include <iostream>
using namespace std;
int main( ) {
    int a[6] = {1, 2, 3, 4, 5, 6};
    int pi = 0;
    int pj = 5;
    int t, i;
    while (pi < pj) {
        t = a[pi];
        a[pi] = a[pj];
        a[pj] = t;
        pi++;
        pj--;
    }
    for (i = 0; i < 6; i++)
        cout << a[i] << ",";
    cout << endl;
    return 0;
}

输出:1
for i=0 to n-1 do
    write(a[i],',')

发表于 2019-10-18 08:51:37 回复(0)
错误解析:漏了逗号
发表于 2019-10-07 13:41:45 回复(0)
发表于 2022-08-26 20:18:27 回复(1)