0 喜歡 0 不喜歡
6.5k 瀏覽

Write a program that echoes its command-line arguments in reverse order. Running the program by typing

reverse void and null

should produce the following output:

null and void

Example 2:

reverse you are one number

should produce the following output:

number one are you
[練習] Coding (C) - 最新提問 分類:C |
ID: 22972 - 從幾時開始: 無限制 - 到幾時結束: 無限制
2 舉報
修改於 用戶: | 6.5k 瀏覽
0 0
Called for Help
0 0
Called for Help
0 0
Called for Help

90 個回答

0 喜歡 0 不喜歡
內容已隱藏
int main()
{
    int n, start, end, i;
    char s[100], c;

* * * * * * **** * ** * ** * * &n) != EOF && n != 0) {
* * ** ** * ** * ** ** *** * ** ** * * * * *** * s);

** ** * * * * **** *** ** * * **** ***** = strlen(s) / n;
**** * * * * *** * ** * **** *** * *** ****** ** * * s[i]; i+=n) {
*** ***** * * * * * *** * * * * ** * ******** * * **** ** * = i;
* ** ** * *** * **** * * **** * ***** ** ****** * * ** * ** *** * * = i + n - 1;
*** ** * ** *** ** **** * ** * ***** ** * * * * * *** * < end) {
**** * * * *** ** *** * * ** ** * ** * * * * * *** * * ** * * * * * ** **** **** ** = s[start];
* * ** ** * **** **** * * *** * **** ** * ** * *** **** ** * ** * * * * * ** * **** = s[end];
* * ** ** **** * ** * ** * **** ** ** ** ** *** ****** ***** ** * * ** ** * ******** = c;

* * ** * * * * * ***** ** ** * ** * * *** *** *** * * ** *** * * ***** ** * * *** * *
** * *** * ** * * ** *** ** *** * * * *** * *** ** *** * *** * ** ** ** * * * * * ** * ** * * *
** * * * ****** *** * * *** * *** * *** **** ** * **** * *** *
* * *** * *** ******* *** ** ** * * * *

* **** * * *************** ** * ***** ** * ** *** * * *** ** ** s);
    }

    return 0;
}
最新回答 用戶: (-134 分)
0 0
prog.c: In function 'main':
prog.c:6:11: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
     while(scanf("%d", &n) != EOF && n != 0) {
           ^~~~~
prog.c:6:11: warning: incompatible implicit declaration of built-in function 'scanf'
prog.c:6:11: note: include '<stdio.h>' or provide a declaration of 'scanf'
prog.c:6:30: error: 'EOF' undeclared (first use in this function)
     while(scanf("%d", &n) != EOF && n != 0) {
                              ^~~
prog.c:6:30: note: each undeclared identifier is reported only once for each function it appears in
prog.c:9:13: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
         n = strlen(s) / n;
             ^~~~~~
prog.c:9:13: warning: incompatible implicit declaration of built-in function 'strlen'
prog.c:9:13: note: include '<string.h>' or provide a declaration of 'strlen'
prog.c:23:9: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
         printf("%s\n", s);
         ^~~~~~
prog.c:23:9: warning: incompatible implicit declaration of built-in function 'printf'
prog.c:23:9: note: include '<stdio.h>' or provide a declaration of 'printf'
0 喜歡 0 不喜歡
內容已隱藏
**** ** * * *
** ** ******
* * * ** ****



int main(){
* char ** ***
** * char *****
** * * * ** int i,j;
****** * * ****
* * **** * int len = *****
* * *   **** ** * * ** **
** * *   * ** == ' '){
* *   ** ** * **** * * *** ** * * * * *
* ** * * * * * ** ** * ** **** * ** ******* * ** * ** * *
** **** * * }
* * ***** * ****** *
** ** ** * **** len = i;
* **** ****** }

}


** * *** * ** ** * * * 0;

}
最新回答 用戶: (-134 分)
0 喜歡 0 不喜歡
內容已隱藏
* * * * *** ****
** * ** * *** * *



int **

{

char **

int
*
* ** *
* *** *** * ** ******

{
* *** ')

{
** * * ***

{
* ** * * * * * * ***

}
* * * * ** *
*

}

}

}
最新回答 用戶: (-134 分)
0 喜歡 0 不喜歡
內容已隱藏
* *** * * ** * ** *
* ** * * * *** ****


* *
** * ** *** * * *
* i, n, m, N;
* ***
* ** ** * **** * ** *

{
***** ')

{
*
* ** * * *** **

{
* * = ****
* * ** ') * *

}
* *
*

}



}
** = n;
** *** ** * ** * *

** **** * * * *
* ***** * *** * * *



*

}
最新回答 用戶: (-134 分)
0 喜歡 0 不喜歡
內容已隱藏
#include * ** *** ** **

#include * ** * * * *



int main()

{
** *** ** * ** ***
** ** * * * temp, * ** ** *


* * **** * *
* * * * = ** * **


* * = 8; i < l; i++)
**
* * * * **** ** == ' ')
* * * *
** *** ** ***
** * * **** *
* * * ****


* ** *
****** * **
* *** * = l;
*


** q *** * q--)

    {
*** * ** *****
* * ****** ** = p[q]; j < l-1; j++)
***** * * * *
*** ** * * * < n)
*** * ******
*** ** * ******* ** * * = * ****
** * ** ** *** ** *** * ** * **** *
* *** * **** *** *
* *** * * * ****
* ** ** **** *
* **** * **
**** * ** = (l-1) - i;
* * ***** ** * *
*** * * *
* ** * ** ** * * ** *
* * * ** *
*** *


* **** = 8; i < n; i++)
** *****
* * ***** * ** * * *
***


** * ** 0;

}
最新回答 用戶: (-134 分)
0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>

#include<string.h>



int main()

{

char a[100];

int i,k,l;

gets(a);

k=strlen(a);
* * *** **** * **

{
**** * ** ***** ** * * ')
* * * ** ** ** * * **** *
****** * ** * * ** * ** ** * * ** ***** * * ** *** * * ** *** *
* * ** * ** *** * * * * * *** ** **
* **** ** * * *** * * ** **** *** * *** * * * * ** ****** * ** * *** *** *** * * * * *
*** ** ** * * * * ** ** * ** * * * * ****
* * * * * ** * * * * * ** ** *** * ***** * * *** ** ** ");
*** ** *** ** ** * **** ** ** * ** **** *** * *
* * * * ** * * **

}

}
最新回答 用戶: (-226 分)
0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>

#include <string.h>



int main()

{
* * ****** * * * * * * i,j,l,m=0,n=0,o=0,p[100]={0},q=0,z=0;
* * *** ***** *** ** * word[100], temp, reverse[100];


***** *** **** * **** * *

    l = strlen(word)-1;


* ***** * * *** ** *** * = 8; i < l; i++)

    {
** * ******* *** ** * * * *** ** * * * ******* == ' ')
*** * * * * * * *** * * ** * * *** **
* **** ** *** * * * ***** ** ** ** ** * **** ** ** **** * * *** *
*** * * ** * **** * *** ***** ** *** * * * ** * ** * * ** *** *
* * * ** ** * *** **** * * ** ** * * ***



    }
* * * * * ***** * **

    n = l;
** **** *** * * * ** ***


** ** *** * * **** * * q >=0; q--)
****** ** * ** * * ****** *
* * ** ******* * *** * * * * **** *** * * **
**** * * * * *** *** * ***** **** ** ***** * = p[q]; j < l-1; j++)
* ** * * * * **** ** * ***
** * ** * **** * ** ** ****** ** ** ** *** ** ** *** ** * *** < n)
* ** * ** * *** * * ***** ** * **** * * * * ** * *
*** * *** * *** ********* **** * * * ** ***** *** ** ** ** * ***** ** * * ** * * *** * * ** **** = word[j+1];
** ** * ** * *** ** * **** *** **** * * ** * * *** * * * * ** *** **** ********** * ***** * * * * word[j+1]);
* * * ** ****** * *** * * ** ** *** * ** ** * * *** ** * *** ** * * * **** ** ***** *
* ****** **** * * ** **** ***** * * ** * * * * * ** ** *** * *** ** **** ** * *** **** * **
* * **** **** * * **** **** * *** * **** ***** * ** *** * * ***
* *** * * ******* *** **** ** * * * *
* * ** ** ** * ***** * * * * *** *** * ** * = (l-1) - i;
**** * * **** * * ** * * ** ***
**** * * * * ** **** * * ***** ** * * *
* * ***** * **** * *** ****** * ** * *** *** * ***** * * ** * ** ");
* * ** ** * **** * * * * ********** * ****

    }


* * * ** * * * * = 8; i < n; i++)

    {
* * * ** * * *** **** *** * **** ** ** * ** * * ** ** * ****

    }


** * * ** ** * * ** 0;

}
最新回答 用戶: (-48 分)
0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>

#include <string.h>



int main()

{
* ** ** * * **** ** * **** i,j,l,m=0,n=0,o=0,p[100]={0},q=0,z=0;
* *** * ** *** ** * *** *** word[100], temp, reverse[100];


**** * ** * **** * *** * *

    l = strlen(word)-1;


** * **** *** ** * ** ** = 8; i < l; i++)

    {
* * ** * * *** ******* ********* ** ** * **** ** == ' ')
** * ** * ** * ** * *** ** *** * * * ** * * *
* * * **** *** ** ** ** * * *** * * * * ** ** * **** *
* * * * ** ** * **** *** *** ********** * ** ** * * ** * * * *
**** * * ******* * **** *** * * * * * *** *



    }
******** ** * * *** **

    n = l;
* ** ***** ***** * * * *


***** * * * * * *** q >=0; q--)
* * * * *** * * ****
* ****** * *** * **** ** ** * ** * * ** *** *
* * **** * *** * * * * ***** * ******** ** = p[q]; j < l-1; j++)
** *** ** *** * * *** * *** * *******
** * * ** ****** ** * **** * * * *** * ** *** *** * ** * *** *** * * * * < n)
* * * * * *** ** ** ***** * **** * * * ***** *** ******* * *
********** * * * * **** * * **** ** *** * ***** * ** * * ** * * ** * * ** * **** * ** * *** * * = word[j+1];
*** * ** ***** ****** * * * ****** * * * * * ** * ** * * * ** *** * ** * * **** ** * * *** ***** ***** * ** word[j+1]);
* ** ** * ***** * ** *** * * ***** *** * * * * ****** ** *** *** * * ** *** *** * *
** * *** * * * * * ***** ***** * * * **** * **** * ** * * ***** * * * **** ******
* ** *** ** * ** * * ***** ** ** * ** * ******* ****** ****
** * ** * * * * * **** * * *** * * * ***
** * ** * *** ***** *** ***** * * = (l-1) - i;
***** * ** * ** *** ** * ** * * *** ** * ***** ** *
* ** * * * ** *** * * *** ** ** *****
** * *** * * * ** * ** ******* *** * ** * * ***** * **** * ** * *** * * * **** * * ** * ");
* ***** ***** ** ** ** ***** **** ** *** * ***

    }


* ***** * * ** ** * = 8; i < n; i++)

    {
* * ** *** ** * * ** ****** * * * * ** * * **

    }


*** * * * *** * *** * * 0;

}
最新回答 用戶: (20 分)
0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>

#include <string.h>



int main()

{
* ******** ** ****** * * i,j,l,m=0,n=0,o=0,p[100]={0},q=0,z=0;
** * * * * ** ** ***** word[100], temp, reverse[100];


* *** ***** ***** * * * * * ***

    l = strlen(word)-1;


**** * * **** ** ** = 8; i < l; i++)

    {
* * * * ** *** * * * ** * **** * * *** ** == ' ')
** ** * *** * * * * *** * ** * ** * * *
* ** ** * * * ** *** ** * ** ******* **** * *** * ** *** * * *
** * * *** **** *** ** * * * ***** * * ** * * * *** * ** *
** * * ** * * *** * * * ** * * **



    }
** **** * *** ** * * **

    n = l;
** *** ********* *


*** *** * ** ** * ** ** q >=0; q--)
****** ****** * * *** ***
* ***** * ** ** * **** * ******* ** * *****
** *** *** ** ** ** ** *** ****** *** * ** = p[q]; j < l-1; j++)
* * * **** * *** ** * * * * *****
** * * **** ***** * * *** * * * ** * ** ***** ** * *** ** *** < n)
** * **** * *** ** * ** ** ** * * * ** ** * ** * * * *
* * *** * ** * * ** * ** **** * * * ** * *** ** **** *** * *** *** * * ** ** ** = word[j+1];
** * ** * ** *** **** *** * * ** * * **** * * * * ***** * * ** * * ** * * ** * **** ** * * * ** ***** *** word[j+1]);
* ** *** * ** * ** * * ** ** * * * **** * ** ** **** * * ** **** ** * * ** ** * * **** * **
* ** **** * * * * ** *** *** * * * * ** ** * * * * * *** * * ******* ** * ***
* * * ***** * **** ** ** * ** ** * ** * * * ** * * * ** * *** *
* * * * * ** ** ** ** * ** ***
* ***** ******* ** * ** **** ** ***** **** ** = (l-1) - i;
****** *** * * * *** * * **** ** **** ** ****
* ** ** * ** * ** ***** ** * *** *
* ******* * ** * *** * *** * * *** * * * * ** * *** * * * * ** ** *** ** ");
** *** ** * * * **** ** * * ** * * * *

    }


*** * * * ** **** * = 8; i < n; i++)

    {
****** * ** * * * ***** * * * *** * * * ** * * * ***

    }


** ** *** * * **** * 0;

}
最新回答 用戶: (38 分)
0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>

#include <string.h>



int main()

{
***** **** ** *** ** **** i,j,l,m=0,n=0,o=0,p[100]={0},q=0,z=0;
*** * ** * ******** * * ** * word[100], temp, reverse[100];


** ** **** * **

    l = strlen(word)-1;


** ** * *** * ****** = 8; i < l; i++)

    {
* * * ***** * ** ** *** * *** ** * * * **** * == ' ')
****** ** ** **** *** * ** ** ** * * **** * * **
*** * * * * ***** * * * * * **** ******** * *** * ** ** ** ** * *
* ** * * * * ** **** * * **** *** ***** * ** * ** * * **** ** * ******* * **
* * * * * * * *** ** ** ** ** * * ***



    }
**** * * ******* * *

    n = l;
* ** ** * ** *** * *


*** *** * * * * ** * **** *** q >=0; q--)
* * * ** * * *** *****
**** ** * ** ** * * ** * ** * **** ** * ** **
* * ** * * * * * ** * ****** * *** = p[q]; j < l-1; j++)
* ****** * * **** ** *** * ** *** ** *
******* *** * *** * * * * * * * * * ** *** * * *** *** * *** < n)
*** ***** * *** * * * * ** *** ** * ** ** * ** ** *
* * **** * * * * ***** * ******* * * ** * * * * **** **** * * ***** ** ** ** * * = word[j+1];
* * *** *** ** * * * **** ** ********** *** ** * * **** * * ** * * ** ** ** * * ***** * * * * * * ** *** word[j+1]);
*** * * * ** **** ** * ** * ** *** * * * * ** ** *** ** *** ****** * * * ****
* * ** * * ** ** ** **** **** * **** * ******** ***** ***** **** * ***** * * * *
* ** * * ** * ** * *** * ** ** * ** * *** ** ** * * **
** * * ***** **** **** * *** * ** * * *** *
* * ** ** * * * * ** * * **** * = (l-1) - i;
* ** * * * * *** * * ** * *** * * * *** * *
* *** ** **** * * * ** * ** * ** **** *** ****
* ** * * *** * ** * ***** ** * * ** *** ** ** **** *** ** *** * * ");
* *** ** *** ** * **** * ********* * * *

    }


* ** *** **** ** * * = 8; i < n; i++)

    {
*** * ***** ************ * * *** *** *** * * ** ** ** * * ***

    }


* **** * * * * ** * * * * 0;

}
最新回答 用戶: (6 分)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.59.240
©2016-2025

相關問題

0 喜歡 0 不喜歡
50 回答
[練習] Coding (C) - 最新提問 3月 16, 2017 分類:C |
ID: 22973 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 3.7k 瀏覽
0 喜歡 0 不喜歡
111 回答
最新提問 3月 16, 2017 分類:C | 用戶: thopd (12.1k 分) | 7.3k 瀏覽
0 喜歡 0 不喜歡
87 回答
[練習] Coding (C) - 最新提問 3月 2, 2017 分類:C |
ID: 22313 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 5.4k 瀏覽
0 喜歡 0 不喜歡
82 回答
[練習] Coding (C) - 最新提問 3月 9, 2017 分類:C | 用戶: thopd (12.1k 分)
ID: 22674 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 5k 瀏覽
0 喜歡 0 不喜歡
18 回答
[練習] 開放式問答 - 最新提問 4月 20, 2017 分類:C |
ID: 24219 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 2.1k 瀏覽
12,783 問題
183,442 回答
172,219 留言
4,824 用戶