2 喜歡 0 不喜歡
1.9k 瀏覽

This program will receive a sentence and reverse it as the result. 字串反轉

Example input 1:

School need Student

Example output 1:

Student need School

Example input 2:

Student

Example output 2:

Student

Example input 3:

are you as bored as I am

Example output 3:

am I as bored as you are

 

[考試] 最新提問 分類:Final Exam |
ID: 42298 - 從幾時開始: 2018-01-17 14:00 - 到幾時結束: 無限制

標籤修改 用戶: | 1.9k 瀏覽

30 個回答

0 喜歡 0 不喜歡
內容已隱藏
** ** * * * * ****
*** * **
** *
int **
{

** * *



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


}
最新回答 用戶: (-336 分)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>
#include<string.h>
int main()
{
*** *** * * **** ** a[100];
* * **** ** *** **** * ***
** * ** ** **** ** * l1;
* *** * * ** * *** ** *
* *** ***** **** * i=0;
* *** ** * * ***** * * * * e=0;
* * ** * * * *** * * **** **** ***
* ** ** ** *** * * ** ** ** * * *** *** * '){
** * *** ** ** *** * * *** ** ** ***** * ** ** ** ** * ** ** **
*** ** * ** ** * ****** * *** **** * ******

** ** ** *** *
** * * * * ** * * **** *
**** * * ** * * * *** ** * * * * * *** ** *** * need School");

*** * ** ** * *
*** * **** * ** * * * * * * if(e==0){
* *** ** ** *** ******* * * ******* * * **** *** ** * ** *
* ** * *** * * * ****** ***
* ******* * * * * * ** ** if(e==6){
* ****** **** * * * * * ** * * **** * * * *** * ** ** I as bored as you are");
    }







}
20/100 最新回答 用戶: (-329 分)
0 0
prog.c: In function 'main':
prog.c:7:8: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
     l1=strlen(a);
        ^~~~~~
prog.c:7:8: warning: incompatible implicit declaration of built-in function 'strlen'
prog.c:7:8: note: include '<string.h>' or provide a declaration of 'strlen'
prog.c:17:16: warning: too many arguments for format [-Wformat-extra-args]
         printf("Student need School",e);
                ^~~~~~~~~~~~~~~~~~~~~
0 0
prog.c: In function 'main':
prog.c:18:16: warning: too many arguments for format [-Wformat-extra-args]
         printf("Student need School",e);
                ^~~~~~~~~~~~~~~~~~~~~
0 0
Case 0: Correct output
Case 1: Wrong output
Case 2: Correct output
Case 3: Wrong output
Case 4: Wrong output
0 0
Case 0: Correct output
Case 1: Wrong output
Case 2: Correct output
Case 3: Wrong output
Case 4: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
** * ** ** *
* * **** * * ** *
* * * * *
int main(){



}
最新回答 用戶: (-32 分)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>
#include<string.h>
int main (void)
{
* * *** * ** * * * ** * b,i,m;
** ***** *** ** * * ** * * **** chaine[1001];
** ********* ******* ** * * * *
** ** * * *** **** * *** * ** **
* * * * *** ******** ** (i=strlen(chaine-1);i>=0;i--)
    {
** * *** ******* *** * * * *** ** ** * (chaine[i]==' ' || (i==0))
* * * ** ** ** ** * * **** * * ** ** * **
** *** ** ***** * * **** * * * * * * * ** *** ** * * ** ** ** * ** **
*** * * ** *** ***** * * *** ** ** ****** ** ** ** *** **
* * * * * * * ** ** ** * ** * * * ** * **** * * ** * * ***** *** * * * ** ****** **** **
* ** *** *** ** * * ** ** **** *** *** * ** ** ** * * * * *******
* **** *** * * ******* * *** *** *** * ***** * * ** **** ** ** **** ** **
* ** * * *** ** * ** * * * **** *
    }
}
最新回答 用戶: (-168 分)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main()
{
    int i,j,end;
    char a[100];
    scanf("%[^\n]*c",a);
    end=strlen(a)-1;
    for(i=end;i>=0;i--)
        {
*** * * ***** * * ** * *** * ** * ** *** * *** * * * ** * **** ')
* * * *** *** *** ** *** ****** ** * **** * * ** * * *** * * * ** * * ** *
* **** *** * * ** ** * ** ** * * ** * * * **** * *** ** * ** *** * * * *** * * * * * ** **** *** ** * *
* * * * * * ** ** * * * ****** * * ** *** *** *** ** * * * * * *** ** * * * ** ** * * *** ** ** * * * *** ** ***
*** ** * ** * * * *** **** *** * ***** * ** * **** **** * ** **** * *** * * *** *** *** ****** **** * **** * ** **** * * ** * *** ** **** * ***** *** ** * * * * * ****** * ** *** ** * *
**** * ** **** ** * * ** * * * * ** *** ***** * ** ** **** **** * * **** * *** ** ** ** **** * * ** * ** * * **** * * *** * *** * ** * * *** * ** ** * * ') break;
* * ** ** ** ** * * **** * ****** * *** ***** ** ** * * ** ** ***** * *** ** * * ** ** ** ****** * *** * *** *****
** * * * * ***** * ***** * *** * * ** * *** ** * * ** ** *** ** *** * ** * ***** ** **** * * ** * ** ** *** ");

** *** * * *** ** * *** ** **** **** * ** * ** * * ** *** ****** ** * * ****
            if(i==0)
* *** ** ** * ** ** * ** *** * * ****** ** *** *** ** * * * * ** ** * *** ** ******* * * *
** * * ** * **** * * * * ** * * *** *** *** **** * **** * * *** * ***** ** ****** *** ** *** ** * * ****** * ******
*** * *** * ** * * * ** * * * *** *** * * * * ** ** * ** * * **** * * * ** * * * * * * ***** * * * *** *** ** ** * ***
* ** * * * ******** * * * *** ** * ** *** * * * ** *** * * * ** * **** ** **** *** * *** * ***** *** * **** * **** * * ** * **** * * ** ** ** * **
***** ** ** * * *** ** * ** * ** * ********** * *** * *** ** ** ** ** *** ** *** ** * * ** * ** ** * ** **** * ***** * **** ** ** * ** * * * * ** * ** ') break;
** *** * *** * * * * * * * * **** *** * * * * *** * ***** * * ** * * * * * ** ** * * * * * ** * *** * ** *********** ****
* * * * *** * ** *** * * * * * ** * **** *** * * ** * ** * ** **** ******* ** * * ** *

        }
        return 0;
}
最新回答 用戶: (-301 分)
修改於 用戶:
0 0
prog.c: In function 'main':
prog.c:8:20: warning: spurious trailing '%' in format [-Wformat=]
     scanf("%[^\n]*c%",a);
                    ^
0 0
prog.c: In function 'main':
prog.c:8:20: warning: spurious trailing '%' in format [-Wformat=]
     scanf("%[^\n]*c%",a);
                    ^
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
0 0
prog.c: In function 'main':
prog.c:8:20: warning: spurious trailing '%' in format [-Wformat=]
     scanf("%[^\n]*c%",a);
                    ^
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
Case 4: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

int main()
{
   int a[100],b[100];
** ** * ** * * ** * * revword[100];
* ** * ** *** ** * ** sword, eword;
* *** * * ** * ** * index=0;
** *** *** ***** len;
*** *** ** ** ** ** * * ****
* * * ***** ** *** * * * ** ** **
** ** * ** ** *** *
* * ** * *** * * * *
* * ** **** **** *** * * *
*** ** * *** * ** *** *
* ** * ** * ** ** **** * *** *** **** * **
* * * * ** * *
** * * *** * * ** * * += ' ')
****** ** * ** * ***
**** * *** * *** * * * * * * * * * * * *
** * *** * * *** * * * ** * * * ***
*** ** *** * * **** *** * * * * ** **** * ** *** * **** * ***** ** * ** * *
* **** * * ** ** * ** * * ** ** * * ** * * ** *** * * * ** *** * *
*** *** * ** * * * ***** ** ** * *** ** **** ** * * * *** * ** ** * * * ****** *** ** * ** *** *** * **
* **** * * * * ** * * * *** ** * * ***** *** ** ********* * * ******

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




* ** ** * * * * * 0;
}
最新回答 用戶: (-193 分)
0 0
prog.c: In function 'main':
prog.c:15:16: warning: passing argument 1 of 'strlen' from incompatible pointer type [-Wincompatible-pointer-types]
     len=strlen(a);
                ^
In file included from prog.c:4:0:
/usr/include/string.h:394:15: note: expected 'const char *' but argument is of type 'int *'
 extern size_t strlen (const char *__s)
               ^~~~~~
prog.c:20:15: warning: format '%[^
   ' expects argument of type 'char *', but argument 2 has type 'int (*)[100]' [-Wformat=]
     scanf("%[^\n]*c%",&a);
               ^
prog.c:20:20: warning: spurious trailing '%' in format [-Wformat=]
     scanf("%[^\n]*c%",&a);
                    ^
prog.c:22:13: error: assignment to expression with array type
     while(a += ' ')
             ^~
prog.c:24:13: error: 'i' undeclared (first use in this function)
         for(i=len-1;i>=0;i--)
             ^
prog.c:24:13: note: each undeclared identifier is reported only once for each function it appears in
prog.c:26:17: error: 'j' undeclared (first use in this function)
             for(j=0;j<=len,j++)
                 ^
prog.c:26:31: error: expected ';' before ')' token
             for(j=0;j<=len,j++)
                               ^
prog.c:28:18: error: 'rev' undeclared (first use in this function)
                  rev[i]==a[]
                  ^~~
prog.c:28:28: error: expected expression before ']' token
                  rev[i]==a[]
                            ^
0 喜歡 0 不喜歡
內容已隱藏
*** * ** * * *
****** * ** * * *

int main{
********* ** ** * * * * *** * ** * **
** *** ****** * ** ** * * need school";
* * * * * c="am I as bored as you are";
**** * **
* ********** *
*** ** * * ** * **** ** *
*** *** * * * * * ** * ******
** ****** ** ** *** * * * **
** ***** *** 0;
}
* * ** *
最新回答 用戶: (-167 分)
0 0
prog.c:4:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 int main{
         ^
0 0
prog.c:4:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 int main{
         ^
0 0
prog.c:4:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 int main{
         ^
0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>
#include<string.h>
int main(void)
{
    char sent[100];
    int i,j,n,k;
* ** * **** * * ** ** * **** * * *
    n=strlen(sent);
    for(i=n-1;i>=0;i--)
    {
*** ** ** ** *** * * ** **** * ** ** * * *** ')
* ***** * ***** **** * * * * *
** * ***** ******* * * ** *** ** * * * ** ** ** * * * *** *** ** * *
* ** *** *** ****** *** ********* * * ** ****** * * ** ****
** ** * * **** ** ** ***** *** ** *** * *** ****** *** *** ******* *** * *** ** ***** ** * ** * **** * **
* * * * * **** ** ******* *** * ** ** * * **** *** *** ** * * * * **
*** * * * * * ** **** * * *** * * *** * * *** *** *
* **** ** * * ** *** ** * * *** ** * ** * * ** * *** * * ** * ");

*** *** * * * ** *** * *** *** ** *
* * * ** **** ** ************** ** * *** * i==0)
*** * * * * * *** ** * * * ** ** ** *
* ** ** * * * * ** ***** ** ** ** ** ******* * ***** *** * * **** * ** ***** **
**** * * * ** * ** * ** * *** * * *** * **** * ** * *** *
* ** * *** * * * ** * * * *** * * ** * **** * *** * *** *** ** ** * ** * *** *** * ** * * * ** *** ** *
* *** ****** ** ** * ** * ***** * * * *** * * * **** ** * ** * *
*** ****** * * * * ** * * ** ******** **

    }
    return 0;
}
最新回答 用戶: (-304 分)
修改於 用戶:
0 0
prog.c: In function 'main':
prog.c:7:7: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
     n=strlen(sent);
       ^~~~~~
prog.c:7:7: warning: incompatible implicit declaration of built-in function 'strlen'
prog.c:7:7: note: include '<string.h>' or provide a declaration of 'strlen'
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
Case 4: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>

void reverse( char *begin, char *end)
{
** * * ** * *** *** *** temp;
*** * ** *** * *** ** ** *** ** * *** *
* * **** **** **
*** * ** ** * *** * * *** * * * * * ** **** * ***** *
* ** ** ** ** ** * * ****** ** * ** ** = *end;
**** * * ** ** * * ** *** * * ** ** * * * * ***** = temp;
** ***** **** *** ***** * *
}

void reverseWord(char *s)
{
** * * * * * ** * *word_begin = s;
* ** *** ** *** * *temp = s;
** * **** **** * * * * (*temp){
* * ** **** * *** ** ********
* * * *** * *** * * * ** * **** (*temp == '\0') {
** ***** * * ** ** ** * * * * ** * * ******* ** ** ** ** temp-1);
** ** * * * * ** * *** * * *
** * ***** * *** * ** * ** *** * **** if (*temp== ' ')
* * ** ** *** * ** ** *** *** ******
* *** *** *** * ** * ** * * ********** * ** * ** ** *** * ** ** ** ** *** temp-1);
**** ** * * ** ** ** ****** ******** * * ** ** * * = temp+1;
* * ** * * * ** *** ** *** ** * * **

* **** * **** * *** ** ** *
* ***** ** ** *** *** * * temp-1);
}


int main(){

char s[1000];
** ** * * * * *** s);
char *temp = s;
reverseWord(s);
*** ** ** * * * s);

return 0;


}
最新回答 用戶: (323 分)
修改於 用戶:
0 0
prog.c:8:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
 int main()
 ^~~
0 0
prog.c: In function 'main':
prog.c:43:8: warning: 'return' with a value, in function returning void
 return 0;
        ^
prog.c:35:6: note: declared here
 void main(){
      ^~~~
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
Case 4: Correct output
0 喜歡 0 不喜歡
內容已隱藏
# include <stdio.h>
# include <string.h>

 int main(void)
 {
     char str[100];
     int i,j;
     int a = strlen(str);
* *** ****** ** * ** * ** * ** **** * * *** ***

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

* * * * * ** ** ** * * **** ** * * * * * **** ' ')
*** ** * **** * * * * ** * * * * * *** ** *** * ****
*** * *** * * * * * ******** * *** ** ** * *** * **** *** * * * ** ** * * ******
** * ***** * ** * *** * * * ** ** * * ****** * *** * ** ** * * *** * * ****
* *** ** * * * * *** * *** **** *** ***** * * * ***** * * ** *** ** **** * ** ** * * * ** * * * *** *
**** *** * ** *** ***** * * * ** ******** ** ** **** ** **** ** *** *** **
*** * * * * * *** * * *** ** *** *** *** * * ** * * * * ** **** ** ** *** ** ");
* * * * ***** ******* *** *** ** * * * * * ** * ** *** * * *** *** ** * = i;
* * * * **** ** *** ** * * * *** *


* ** *** ** **** *** * ** *** ** ** * * * * * * **
* **** * * **** * * * *** ** * ** ** * ***
* ** ** *** * * ***** * * * ** ****** *** ** * *** * ** ** ** * ** * *
* * * **** * * ** * * *** * ** ** *** * **** * * *** * * ***** ** * * **** * *** ** ** * *** * *** **
* * * * * * * * * * * * *** ** * ** * *** ***** *
     }
**** ** * *** * * *** * ** 0;
 }
最新回答 用戶: (-281 分)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.100.198
©2016-2024

相關問題

1 喜歡 0 不喜歡
37 回答
[考試] 最新提問 1月 16, 2018 分類:Final Exam |
ID: 42302 - 從幾時開始: 2018-01-17 14:00 - 到幾時結束: 無限制
| 2.4k 瀏覽
2 喜歡 0 不喜歡
31 回答
[考試] 最新提問 1月 16, 2018 分類:Final Exam |
ID: 42301 - 從幾時開始: 2018-01-17 14:00 - 到幾時結束: 無限制
| 2.4k 瀏覽
1 喜歡 0 不喜歡
32 回答
[考試] 最新提問 1月 16, 2018 分類:Final Exam |
ID: 42300 - 從幾時開始: 2018-01-17 14:00 - 到幾時結束: 無限制
| 2.7k 瀏覽
1 喜歡 0 不喜歡
37 回答
[考試] 最新提問 1月 16, 2018 分類:Final Exam |
ID: 42299 - 從幾時開始: 2018-01-17 14:00 - 到幾時結束: 無限制
| 2.7k 瀏覽
0 喜歡 0 不喜歡
12 回答
[考試] 最新提問 1月 19, 2018 分類:Final Exam |
ID: 43459 - 從幾時開始: 2018-01-20 09:00 - 到幾時結束: 無限制
| 970 瀏覽
12,783 問題
183,443 回答
172,219 留言
4,824 用戶