3 喜歡 0 不喜歡
3.7k 瀏覽

You have received an encrypted message from Julius Caesar-- the message is ebiil.  You are asked to decipher the message in order to understand what Caesar trying to say to you.

Hint

Luckily, Caesar has given you a hint, he says: 'I, myself, encoded the message by shifting every word backwards by 3.' 

Solution

Write a program that receives 5 characters 'ebiil'. Then decode those characters into 5 new characters.

Example

#include <stdio.h>

int main(int argc, char *argv[]) {


	char a;
    	char b;
	 	
	scanf("%c%c", &a, &b);
	
	//decode the message how??
	
	printf("%c%c", a,b);
	
	return 0;
}

Input

ebiil

 

 

 

 

 

 

 

 

 

 

Output

hello

** REMEMBER ** 
This is an online-compiler, don't put anything except the codes. If you want to make a comment, please use // or /* */

[練習] Coding (C) - 最新提問 分類:Chapter 2: Syntax structure of the C language | 用戶: (5.9k 分)
ID: 26955 - 從幾時開始: 無限制 - 到幾時結束: 無限制

修改於 用戶: | 3.7k 瀏覽

22 個回答

0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>

int main (int argc,char *argv)
{
    char a;
** ** ** ** ** ** * b;
* ** * *** * * * * * c;
* * ** ***** ****** * * *** d;
*** ** *** * * **** e;

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

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

*** *** * ** *** ** *** * *** * * * *** * * **** * *
**** *** * *** **** ** * 0;
}
100/100 最新回答 用戶: (244 分)
0 0
Case 0: Correct output
Case 1: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
#include * ** * *
int main(int argc, char *argv[]) {


* ** * char a;
* ** * ** * * * ** ** * b;
* * * *** ** * ****** c;
* * *** * *** * * * **** * d;
*** * ** * * ***** *** * ** e;
* * * *** * ** * *** *** *
* * *** * ** **** * ** ** * ** ** *** * ** * * ** ** *** ** *
** * * ** *
* * * ** * *** the message how??
* * ******
** ** *** * ** ***** **** * ** *** * ** ** ***
* * * * **
* ** *** ** return 0;
}
100/100 最新回答 用戶: (221 分)
0 0
prog.c: In function 'main':
prog.c:10:2: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
  scanf("%c%c%c%c%c", &a, &b, &c, &d, &e);
  ^~~~~
prog.c:10:2: warning: incompatible implicit declaration of built-in function 'scanf'
prog.c:10:2: note: include '<stdio.h>' or provide a declaration of 'scanf'
prog.c:14:2: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
  printf("%c%c%c%c%c", a+3,b+3,c+3,d+3,e+3);
  ^~~~~~
prog.c:14:2: warning: incompatible implicit declaration of built-in function 'printf'
prog.c:14:2: note: include '<stdio.h>' or provide a declaration of 'printf'
0 0
Case 0: Correct output
Case 1: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
int main(int argc, char *argv[]) {


  char a;
*** **** * ** * ** ** b;
* * * * ** char c;
** * ** * **** * * *** d;
*** * **** * * ** * e;
** ** ** ** * * * * * * *****  
    * ** *** ** %c %c %c %c * ** ** **** * **** * ** ** * ** *
** **  
    * ** *** *** ****** * * **** * ** * ** ** * ** ***** ** * * **
**** * ***** * * *** *
** * *   * *** **** * * *
* *** ***** ** ** * * *
* * * **** * * * * ** * * *
*** **** * ** * ** **
* *** * **** * *** * * * *** * *
* ** ***** * *
* ** ** * ***** * 0;
}
50/100 最新回答 用戶: (244 分)
0 0
prog.c: In function 'main':
prog.c:10:2: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
  scanf("%c %c %c %c %c %c", &a, &b,&c, &d,&e);
  ^~~~~
prog.c:10:2: warning: incompatible implicit declaration of built-in function 'scanf'
prog.c:10:2: note: include '<stdio.h>' or provide a declaration of 'scanf'
prog.c:10:25: warning: format '%c' expects a matching 'char *' argument [-Wformat=]
  scanf("%c %c %c %c %c %c", &a, &b,&c, &d,&e);
                         ^
prog.c:12:6: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
  if(a="e",b="b",c="i",d="i",e="l")
      ^
prog.c:12:12: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
  if(a="e",b="b",c="i",d="i",e="l")
            ^
prog.c:12:18: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
  if(a="e",b="b",c="i",d="i",e="l")
                  ^
prog.c:12:24: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
  if(a="e",b="b",c="i",d="i",e="l")
                        ^
prog.c:12:30: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
  if(a="e",b="b",c="i",d="i",e="l")
                              ^
prog.c:14:2: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
  printf("hello");
  ^~~~~~
prog.c:14:2: warning: incompatible implicit declaration of built-in function 'printf'
prog.c:14:2: note: include '<stdio.h>' or provide a declaration of 'printf'
prog.c:18:5: warning: incompatible implicit declaration of built-in function 'printf'
     printf("errol");
     ^~~~~~
prog.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
0 喜歡 0 不喜歡
內容已隱藏
**** * ******* * * *

* * * ** * * *** {

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

e = *
=
= **
= *

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

*** ** ** **** * * * ** * ***
100/100 最新回答 用戶: (183 分)
0 0
Case 0: Correct output
Case 1: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
** * ** ** ***

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

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

e = *
= *
** = *
= ***

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

* * **** ****** * * ** **
**
100/100 最新回答
0 0
Case 0: Correct output
Case 1: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
#include ** ** ** * **
#include ** *** *** *

int main(int argc, char *argv[]) {
* ** * ** **** **** letterj;
** * * * ** **** **** letteri;
* * ****** ** *** * * ** letterm;
**** *** * ** * * lettere;
***** *** * ** * * * lettern;
** * * * *** * *
* *** * * * *** *** * ** ** *** input the letter to encode: ");  
* * ** * * *** ** **
*** * * ** * * ** ** * * * ** * ** ** **** &letterj, *** * * &letterm, ** * ** * * * * ***
** * *** ** ** * ** * * * +3;
** * * * ***** ** * *** ** ** * +3;
* ** ** * * * * ** * ** * +3;
* * * ** * ** **** * * *** +3;
** * * * * *** ** * *** *** * +3;
* * ** * ** **** **
***** * * * *** **
** * * ** * * *** * ***** * ** * ***** *** ** * lettere, lettern);
** * ** ***** * * * *
**** *** ** *** * * *** *** 0;
}


INPUT
** * *
*** ** * **
OUTPUT
***** * ** * * ****
100/100 最新回答 用戶: (243 分)
0 0
prog.c:27:1: error: unknown type name 'INPUT'
 INPUT
 ^~~~~
prog.c:30:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'OUTPUT'
 OUTPUT
 ^~~~~~
prog.c:30:1: error: unknown type name 'OUTPUT'
0 喜歡 0 不喜歡
內容已隱藏
* * **** * * *

int * * argc, char *** {


* ** * ** * ** char a;
* * * ** ** *** * ***** * ***** * char b;
** ** *** * *** * * *** **
***** * * * ** ** ** * ** * **** ** *
** * * ** **
* * *** * * the * * how??
*** ** * * **
* * * * * ******* * ** * a,b);
* * * **
** * ***** ** * 0;
}
50/100 最新回答
0 0
Case 0: Wrong output
Case 1: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
#include **** ***

int main(int argc, char *argv[])
{
* ** * letterj;
* ** * * ** letteri;
*** * *** ** * * * ** letterm;
** ** * ** * * * ** lettere;
* ** * ** * ** **** * * lettern;
* * ** **** ** ** * * **
** * * *** *** *** * ** ** * ** input the letter to encode: ** * * **
** *** **** * * * * * ***** ** * ***** * *** ** * * * * * *** * * ** * **** *** ******
** *** * *** * *** ** *** * *
* * *** *** ** * *** ** *** = letterj +3;
** * * *** ** * * * = letteri +3;
* *** * **** * * * **** ** ** = letterm +3;
* ** ** * * ** *** * = lettere +3;
***** ***** ** * = lettern +3;
* *** * * * ** * * **
** * ** * * * ** *** * * ** * * * * *** * ****** ** lettere, lettern);
* * * ** * ****** * *

** ** ** * * 0;
}
100/100 最新回答 用戶: (220 分)
0 0
Case 0: Wrong output
Case 1: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
* ** * ** ** **

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

** **
** = ** *
= * * *
i = *
* = * ** *
* = * * **
e =
* = * *
= ***
* = *

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

** * ** ** ** **** ** * **
100/100 最新回答 用戶: (283 分)
修改於 用戶:
0 0
prog.c:1:16: fatal error: stdio: No such file or directory
 #include<stdio>
                ^
compilation terminated.
0 0
prog.c: In function 'main':
prog.c:6:5: error: 'cin' undeclared (first use in this function)
     cin >> a;
     ^~~
prog.c:6:5: note: each undeclared identifier is reported only once for each function it appears in
prog.c:11:5: error: 'cout' undeclared (first use in this function)
     cout << a << endl << endl;
     ^~~~
prog.c:11:18: error: 'endl' undeclared (first use in this function)
     cout << a << endl << endl;
                  ^~~~
0 0
prog.c: In function 'main':
prog.c:6:11: warning: too many arguments for format [-Wformat-extra-args]
     scanf("c", &a);
           ^~~
prog.c:11:14: warning: format '%c' expects argument of type 'int', but argument 2 has type 'char *' [-Wformat=]
     printf("%c", a)
              ^
prog.c:12:5: error: expected ';' before 'return'
     return 0;
     ^~~~~~
0 0
prog.c: In function 'main':
prog.c:6:11: warning: too many arguments for format [-Wformat-extra-args]
     scanf("c", &a);
           ^~~
prog.c:11:14: warning: format '%c' expects argument of type 'int', but argument 2 has type 'char (*)[5]' [-Wformat=]
     printf("%c", &a);
              ^
0 0
Case 0: Correct output
Case 1: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
#include ** **** * * * *
#include *** *** ** * ***

int main(int argc, char *argv[]) {
**** * ** *** * letterj;
** *** * ** ** * * * letteri;
* * ** ** ** **** letterm;
* ** ** ** *** * * * * *** lettere;
* ** ** * * *** lettern;
** ** * * * * ** *
** **** * * ** * * * **** * *** * input the letter to encode: ** * * *  
** ** **** * * ******* ***** * **** ******* ** * * * ** ** * ** * * ** * ** * * ** * * ** * * ***** * *
** * ** * ** ***
*** ** * **** letterj = letterj +3;
** * ** ** ** *** * = letteri +3;
* * * * * * * *** ** * * * = letterm +3;
** *** *** * * * * *** ** = lettere +3;
** ****** *** ** * ** = lettern +3;
* * * * * **
*** ** *** * * * ** ** ** ** ** * * * ** * * **** *** ** **** lettere, lettern);
** *** **** ***
** * * ** ** **** ** * 0;
}
100/100 最新回答 用戶: (220 分)
0 0
Case 0: Wrong output
Case 1: Wrong output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.131.157
©2016-2025

相關問題

0 喜歡 0 不喜歡
2 回答
[正常] 開放式問答 - 最新提問 12月 12, 2017 分類:Chapter 2: Syntax structure of the C language | 用戶: 許哲瑋 (449 分)
ID: 37081 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 556 瀏覽
12,783 問題
183,442 回答
172,219 留言
4,824 用戶