0 喜歡 0 不喜歡
4.6k 瀏覽

Please write a program, including function(s), that receives one input number, then shows the squared value of the input.

Input 1

10

Output 1

10
100

Input 2

12

Output 2

12
144

[練習] Coding (C) - 最新提問 分類:Chapter 3: Branching, Looping and Functions | 用戶: (5.9k 分)
ID: 39810 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 4.6k 瀏覽

16 個回答

0 喜歡 0 不喜歡
內容已隱藏
#include * ** * *****
#include ** * *** ** **

int ****** *
void * * number);

int main(int argc, char *argv[])
{
*** ** *
** *** *** a;
* * * **** * = *
**** ***
* * * * *
***** ** * ***** ***
* * * * * * * * * *** ** *
*** *** * * *** 0;
}

void **** ** number){
* ** * **** * *** * ** *** * ** * **
***** * *** ** **** * * * ** *
}

int * * *
* ** * * * ** *** * * x;
***** ** * * ** * ** * *** ** &x);
** * * * * *** * **** x; * *** * * ***
}
100/100 最新回答
修改於 用戶:
0 0
/tmp/ccBixDvw.o: In function `main':
prog.c:(.text+0x15): undefined reference to `readNumber'
collect2: error: ld returned 1 exit status
0 0
/tmp/ccU0sfkC.o: In function `main':
prog.c:(.text+0x15): undefined reference to `readNumber'
collect2: error: ld returned 1 exit status
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include ** ** *
#include ****** * *****

int * ** *
void *** * * number);

int main(int argc, char *argv[])
{
* * *** **
** *** a;
** * * * * = *** ***
* *** * **
**** * *
* * * * * * * * **
* * * * * * ** * *** ** ** * **
* * **** * 0;
}

void ** ** * number){
**** ** ** ***** ********* * * * * ***** ** ******
* *** ** * ** *** * ***** *** ***
}

int *
* * * ** ***** *** x;
* **** * *** ***** ** *** ** * * ** * &x);
* *** * **** ** ** **** * x; **** * * ****** * *
}
100/100 最新回答 用戶: (183 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 喜歡 0 不喜歡
內容已隱藏
* * * * ** **
*** ***** ****** *

int main(){
*** * *** * int s,n;
* *** * **
** *** * * *** *** ** * **** ** * * *
* ** **
  n=s*s;
* * * *****
* * * * ** ** * * ** ***
}
100/100 最新回答 用戶: (244 分)
修改於 用戶:
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 喜歡 0 不喜歡
內容已隱藏
** * * ** * * *
* * * * * * * *

int ** * * **
void * * * * number);

int main(int argc, char * *
{
* *** * * * *
* * * ** * x;
*** * = *** * *
* * *
* ** * ** * * ** * *

** ******** * ** 0;
}

void ** *
** * * * ** ** * ** **** * * ****** * * *
** *** ** * * * ***** ** ** *
}

int **** *
** * ***  int y;
** ** ** ***** * * *
* *** * ** y;    
}
80/100 最新回答 用戶: (269 分)
0 0
prog.c: In function 'main':
prog.c:10:2: error: stray '\302' in program
  \xc2\xa0int x;
  ^
prog.c:10:3: error: stray '\240' in program
  \xc2\xa0int x;
   ^
prog.c:11:2: error: stray '\302' in program
  \xc2\xa0x = readNumber();
  ^
prog.c:11:3: error: stray '\240' in program
  \xc2\xa0x = readNumber();
   ^
prog.c:13:2: error: stray '\302' in program
  \xc2\xa0writeNumber(x*x);
  ^
prog.c:13:3: error: stray '\240' in program
  \xc2\xa0writeNumber(x*x);
   ^
prog.c: In function 'readNumber':
prog.c:24:2: error: stray '\302' in program
  \xc2\xa0 \xc2\xa0int y;
  ^
prog.c:24:3: error: stray '\240' in program
  \xc2\xa0 \xc2\xa0int y;
   ^
prog.c:24:5: error: stray '\302' in program
  \xc2\xa0 \xc2\xa0int y;
     ^
prog.c:24:6: error: stray '\240' in program
  \xc2\xa0 \xc2\xa0int y;
      ^
prog.c:25:2: error: stray '\302' in program
  \xc2\xa0 \xc2\xa0scanf("%d", &y);
  ^
prog.c:25:3: error: stray '\240' in program
  \xc2\xa0 \xc2\xa0scanf("%d", &y);
   ^
prog.c:25:5: error: stray '\302' in program
  \xc2\xa0 \xc2\xa0scanf("%d", &y);
     ^
prog.c:25:6: error: stray '\240' in program
  \xc2\xa0 \xc2\xa0scanf("%d", &y);
      ^
prog.c:26:2: error: stray '\302' in program
  \xc2\xa0 \xc2\xa0return y; \xc2\xa0 \xc2\xa0
  ^
prog.c:26:3: error: stray '\240' in program
  \xc2\xa0 \xc2\xa0return y; \xc2\xa0 \xc2\xa0
   ^
prog.c:26:5: error: stray '\302' in program
  \xc2\xa0 \xc2\xa0return y; \xc2\xa0 \xc2\xa0
     ^
prog.c:26:6: error: stray '\240' in program
  \xc2\xa0 \xc2\xa0return y; \xc2\xa0 \xc2\xa0
      ^
prog.c:26:17: error: stray '\302' in program
  \xc2\xa0 \xc2\xa0return y; \xc2\xa0 \xc2\xa0
                 ^
prog.c:26:18: error: stray '\240' in program
  \xc2\xa0 \xc2\xa0return y; \xc2\xa0 \xc2\xa0
                  ^
prog.c:26:20: error: stray '\302' in program
  \xc2\xa0 \xc2\xa0return y; \xc2\xa0 \xc2\xa0
                    ^
prog.c:26:21: error: stray '\240' in program
  \xc2\xa0 \xc2\xa0return y; \xc2\xa0 \xc2\xa0
                     ^
0 喜歡 0 不喜歡
內容已隱藏
#include ** * *** *
#include ***** ** *

int ** * *
void * * * * number);

int main(int argc, char *argv[])
{
** * * ** *
** * ** * * a;
* * * * **** * = ** ** ***
* * **
* ****
** ****** * ** **
* ** *** * ** ** * * ** *
**** **** ** * 0;
}

void ** * number){
**** * * *** ** * * ***** *** * ** * **** ****
** ** * * * * * * ***** ***
}

int * * * **
***** *** * * * * * * x;
* * * * ** * ** ******* ** * ** &x);
** * * * * * ** * x; * * **** *** * * **
}
100/100 最新回答 用戶: (192 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include * ****
* * ** * *** ** *

int ****
void * **** * number);

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

* * * ***** *** 0;
}

void ** * ** number){
* *** * * * ***** *** * * * **** ** * ** *
** *** *** ** * * * *
}

int *** *
** * ** * ***** ** ** ** x;
* ** *** ** **** * ** * * **** ** * ***
* * * * * ** ** x; ** ** * **
}
100/100 最新回答 用戶: (281 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include ** ********** *
#include ** * ******

int * *****
void ** *** number);

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

** * * * * * 0;
}

void * **** * number){
** * ******* * * * ** ** ***** * ** ** * *
* *** ** * *** **** ** ****** ***
}

int * * **
*** ** *** * * *** * * ***** x;
*** ***** * * * * ** *** ** * * ** *
* * ** * * * * * * x; ** * * *** **** *
}
100/100 最新回答 用戶: (269 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include ** *** * ****** *
#include ** ** ** **

int * *****
void * * * number);

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

* ** *** **** 0;
}

void * *** number){
* ***** ** ****** ** * ** * ** ***** ** * *
*** ** * **** *** * * *
}

int * ***
* * * * ** ** * * ** * x;
**** * * * * ****** **** ** ** * ** * * * *** * * *
** ** ** ** ****** * * x; * ** * * ** ** **
}
100/100 最新回答 用戶: (221 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include ** **** *
#include * ** ** ** *

int ** *
void ** * number);

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

** *** ** * 0;
}

void * * * *** number){
*** ** * *** * **** * ** * * * * * *
** ** * * ************ ** * ** *
}

int ** *
* ** * * * **** ** * ** ** x;
** * * * ** ** * * *** * * ** * **
*** ** * *** ** * * * * ** ** x; ** * *** ***
}
100/100 最新回答 用戶: (273 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include ** ***** ***
#include * * * * * ** *

int * * ** *
void * * number);

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

** * ** 0;
}

void **** number){
** *** * ******* * * *** *** * * * *
** * *** * ** ** * *** * **
}

int * **
* * * * * ** *** ** * *** x;
*** ** ** * *** * *** **** ** ** ** * ** *
* * ** *** ** * ** * x; * *** ** ** ** *
}
* **
100/100 最新回答 用戶: (290 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.59.81
©2016-2025

相關問題

0 喜歡 0 不喜歡
22 回答
[練習] Coding (C) - 最新提問 12月 30, 2017 分類:Chapter 3: Branching, Looping and Functions | 用戶: nat236919 (5.9k 分)
ID: 40236 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 5.7k 瀏覽
0 喜歡 0 不喜歡
18 回答
[練習] 克漏字填空 - 最新提問 12月 23, 2017 分類:Chapter 3: Branching, Looping and Functions | 用戶: nat236919 (5.9k 分)
ID: 39813 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 2.5k 瀏覽
12,783 問題
183,442 回答
172,219 留言
4,824 用戶