3 like 0 dislike
3k views
Show more...
[Exam] asked in 2017-1 程式設計(一)AD by (30k points)
ID: 38938 - Available when: 2017-12-23 09:00 - Due to: 2017-12-23 12:10
| 3k views

12 Answers

0 like 0 dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int i,j,x,y;
    while(scanf("%d %d",&x,&y)!=EOF)
    {
* * *** * *** * **** * ** * ** * array[x][y],non[x*y][3],count=0;
* * * ** ** * **** *** * ** ** ***** * *** *** ***** * * *** * ***
** ** *** * *** * * **** * * ** **** * * ** * ** ** *** * *** * **** * * * * *
** ** * **** * * ** *** ** *** * *** *** ** * ** * * ** **** * ***** ** * ** * * ** *
** * **** * * **** ** **** ** *** ******* * ** ** ** **
* **** * * * * ** ** ***** ** * * *** * * * * * * ** ** ** * * **
*** * ** ** * ****** ** * * * ** * * ** * ** *** ** ** *** * * * ***** * ** * ** ** * ** * * * * *
* ****** ** * ** * * ******* *** *** * * ** ** ***
        {
*** * * ****** ** * * * ** * * ** ***** * **** * **** * * *** * * ** ** * * * **
*** * ** ** ** * * *** *** * *** ** * ** * ** * *** *
** * * *** *** * ** **** ** ** **** ** * ****** *** *** * ****** ** * * * ** * ** * * ** * *
*** * ** * * * **** *** * ***** * * * ***** *** ** * ** * * ** *** ** ****** **
* * * *** ** * * * ** * ** * * * ***** ** *** ** **** * *** * * * * ** * **** * *** * * * * ** * * * * ** *
* ** * ** * * * *** * ******** * * * * ***** * ** * * ** ****** * * * * ** * * * * * * *
* * **** * ** *** ** ** *** * *** * *** * * **** * * * * *** *** ** ** * * * ** *** ** ** *** ** * * *** * * ** ** **
* ** * * *** ** *** * * * * ** * * * * ** * * ** ** * * *** * ** * ** **** * *** **** * *** **** * * * **** *
** ***** * ***** ***** * * *** ** ** * ** ** *** * * ** **** * *** ** ** * ***
* *** * * ** *** **** * * * *** ******* * ** ** ** * * ** * **
* ***** **** *** * *** * ** * ***** **
* **** * *** ** **** * ***** *** * ** * *********** %d %d\n",x,y,count);
** ** * ** * **** * * *** * * *** *** *** * ***** *
        {
* * **** ***** *** * *** **** * *** ** * * ** * ** * * *** ** * ** * ******* ** * %d %d\n",non[i][0],non[i][1],non[i][2]);
* ** * ** * ** * ****** *** *** * *** *

    }

    system("pause");
    return 0;
}
answered by (114 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 like 0 dislike
Hidden content!
#include<stdio.h>
int main(void)
{
   int a,b,i,j,num=0;
   int ch[a][b];
* ** * * ** * *** * * *** *** *
* * ***** *** *** * *********
   {
* ** * **** * **** ** *** * ***** * ** * *** * *
* * ******** ** * ******* * *** * *
* ** ** * *** ** ***** * **** * * * **** *
* **** * *** * ** *** ** * * * * * * **** ** *
***** * ** * * ** * *** * * *** * ** ** **** * *** * * * *******
****** * *** * * * * * ** * * * ** ****
** ** ** ** * * ** * * *
   }
* ** * * * * *** %d %d",a,b,num);
*** ** * ***** ** * * *** ****
***** *** ** * *** **
** *** * * * **** * * * * * ** ** *
* ** ** ** **** *** ** * * ***
* * ** ** * * *** *** * **** ** * * * * ** ***** * *
*** ** ** * *** * ** *** *** * * ** * ** ** ** ** * ***** * ** %d %d\n",i,j,ch[i][j]);
*** * ** ** * * *
* * * *** * * * * **

   return 0;
}
answered by (162 points)
0 0
prog.c: In function 'main':
prog.c:6:12: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'int' [-Wformat=]
    scanf("%s",ch[a][b]);
            ^
0 like 0 dislike
Hidden content!
#include<stdio.h>

int main(){
    int a,b,i,j,num=0;
**** * * * * ** * ** * ** *** ************** *
** * * * ****** **** ** * ** * * ** * *** *
    int ch[a][b];
* ** ***** * **** *** ** *
* *** * * *** *** ** * **** * * * * ** * ** * ** *
**** * * * * *** ** ** *** * ***** * **** * * ** **** * * ** * * * ****** * **
* * ** ** * * * ***** * *** * * *** **** ** * * * * * * * ** ** * ***
*** * * ** *** * **** * * ** * ****** ****** * ** * ***** *** * *** *** ** ** * * ** ***
*** *** * * ** ** * ** *** ** * * * * **** **
* * **** ** * **** *** *** ** ** ***** **
    }
    printf("%d %d %d\n",a,b,num);
** ***** * ** **** * ***** ** * **
** * ** ** ** ** * *** ** * ** ** *** ****** **
* * * * * ** * ****** ***** *** *** * * * * ********* ****** ** ** ***
** ***** ** *** * * * * * *** ** **** * *** ** * * *** * * * ** * ** * * **** * * * *** %d %d\n",i,j,ch[i][j]);
* * * * **** *** * *** * **** * *** * * *** * * * ******* * *** * ***** ***
* ** * * *** ******* * ** * **** * ** *** * * *** * * *** ** *******
** *** ** * **** * *** * * *** *
    }
}
answered by (196 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 like 0 dislike
Hidden content!
#include<stdio.h>

int main(){
    int a,b,i,j,num=0;
**** * * * *** ** *** ** * ** * **********
* * ******* ** ** * **** *** ** * ** ** * *** * ** *** *
    int ch[a][b];
* * * ** * ** *********** ** ** * ** *
* *** * * ** * * *** **** * *** * ** * * * * ** * * * * ** ** *
*** ** ** * ** ** * **** * ** * * ** ** * **** * **** *** * *** * ** ** *
*** * * * * *** *** *** * ** ** ** * * ** ** ****** * * * * ** ***
* * * * ***** * * * **** * **** ** * * * *** * ** * **** ** ****** ** * *** ** * * ** * ****** * *
*** * * * ** * * * **** **** * * ****** * ** * * **
** *** * * * ** ***** * * * ** * *** ***** * **
    }
    printf("%d %d %d\n",a,b,num);
** *** ** * * ** ** * *** * * ***
***** * *** *** * ** * * * ** ** *** * * **** ** **
*** ** * *** **** *** * ******* * * * * ******* * ** ******* ** * ** ** * *
**** * * * *** * * ** * * ** * ******* * * ** *** * ** * ** * *** ******* ***** ****** * **** ** %d %d\n",i,j,ch[i][j]);
* ** *** * *** *** ** * **** ** * *** ** ***** **** * * *** *** * ***** **** * ***** * *
***** **** ** *** * ** ** * ** * ** ** * *** * * *** *** * * * *
* * ** * * ** * ** * ****** * ** ***** *
    }
}
answered by (131 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 like 0 dislike
Hidden content!
#include<stdio.h>

int main()
{
****** ** * * * * * **** a, b, i, j,num=0;
* * *** ** ** * ****** * ** * * **** *********
***** ** * ** * * ** * *** * *** ** ***
    int ch[a][b];
** * *** * ** * ** * *** * ** *
* ****** * * ** * * *** ***
**** * ** * * ** * ** * * * * * * *** *
* ** *** ** * * * ** ** ** **
** ** * **** *** ++;
}
}
}
* ** *** * * * * * ***** * ** ******** * %d %d\n",a,b,num);
* * * * * * * *** * * ** * * **
** * * * * ** * *** * ** ** * * *
* ** * * * * **** *** * * * ***
** ******** * **** * ** * ** %d %d\n",i,j,ch[i][j]);
}
}
}
}
answered by (164 points)
edited by
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 like 0 dislike
Hidden content!
#include<stdio.h>

int main()
{
    int a,b,i,j,num=0;
    
* * * * * **** **** * * * ** ** ** * **
* * * ** *** * **** *** * ** * * * * * * * * ** **
    
    int ch[a][b];
    for(i=0;i<a;i++)
    {
* ** *** * * *** * * * ** * * ** * * ***** * * ** **** * **** ******** ** ** * * * * * ** ** * * ***
**** * * ** * * *** ** * * ** ** * ****** *** ****** * **** ** * ** * * ****** * *********** * * *** ** * *
* ** * * * ** * ** * * * * *** ********** ** * ****** **** * * * *** * * ** ** * *** ** ** ******** * * *** * ** * ** * * ***** * ** * * * ** **** ** * ** ** ** **** * * *** * * **** *** ** ** * **
**** ** * * * ********** ** * ****** * * *** ****** * * * ** * * ** * * ****** **** * * * * ** * **** **** * * * * * ** * *** * *** * ** **** * * * ** ** * * ** * * * * **** * *** ** * * (ch[i][j]!=0)
* ** * * ** ** ** * * * * * ** * **** ** ** * *** * * * ** * * * * * * * * * * * * * ** *** * * * * ***** * *** * * * * ** * * ***** **** *** ** ** *** ** *** ** *** * ** ** * * * *
** * *** * ** ** ** **** ** ***** * * ** * * * ** * *** * *** * *** ** * * * ** ** ** * * * * * *
    }
    
    printf("%d %d %d\n",a,b,num);
    
    for(i=0;i<a;i++)
    {
** * * * ** * * *** * * *** * ** *** *** * ** * * ** * ** **** ** ** ** * * ** * * * ** * * ** **
** **** * ** ** * * * * * ** * * * **** ** * * ** * * * * ** * * *** * *** * * ** * ***** * ** ** ** ** * ** ****
* ** * ** * ** * ** *** ** *** ** ** * * ** ** ** * ****** ***** ** ** * * * * *** * **** ***** * ***** ****** ** ************ * * * *** ** * ** * * *** * * * ** **** * ** ** ** ** ** *** (ch[i][j]!=0)
*** * ** * *** * ** * *** * ** *** * ** * ****** * ** * ** ** * * * ** ** ** ** * * **** *** * * * * * * **** * *** *** * * * * *** *** * ** ** ******* * * * * *** * * * ******** *** * * * %d %d\n",i,j,ch[i][j]);
* ** ***** ** * * * * * * ** * * ** *** ** * * * * * *** * * ** * *** ***** ** *** ** ** ** ** ** ** ** *** * *
    }
}
answered by (215 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 like 0 dislike
Hidden content!
#include<stdio.h>
int main()
{
    int i ,j,a,b,num=0,x=1;
*** ***** * * *** *** * *** **** ** * **
    int arr[i][j];
    int m[1000][3];
* * ** * * * * **** ** **
*** ***** ** * *** ***** *
* ** ** * ** * ** *** * *******
    {
* * * * * ** * ***** **** ** ***** ** ** * * * * *** * *
* *** * * ** ** *** **** * ** * *
* * ** ** ** * * * *** *** ** * **** *** * * *** ***** ** **** * *** * * *** * * *** ** * ** * * *****
* ** ** * ** * * * * ** * ** ***** * * *** * * *** * ***
** * * * * * * **** * * ** ** * * ** * * **** ** ** * *** ** * ** *   m[x][0]=a;
**** * ** *** * ** * * * ***** * *** **** * * * * * * * *** ** * ** * ** * *
* * ** * ** * ** ** **** ** * * ** * * * ** * **** * * ** ** ** ** **
*** * * *** * *** **** * * * *** ********** *********** ***** * * * * * * * ** ** * * ** *****
* ****** *** ***** * * * * * * *** ***** * * ** ** * * * * * *** *** * * * *
* ******* * * * * ***** ** * * * * ***** *** ****** * * ****** *
** * * ** * * * ** ** ** ** ** **
    }
* * * * * * ** *** **** * *
* ** *** ****** * ** * *** * *
    {
** * * *** ** * * ****** * * * * *** ** **
* * ******** * ** * ** * * * **** **** * * ** **** ** * ",m[a][b]);
** * ** *** *** * ** * ** ** * **** * * * * ** ***** **
    }
}
answered by (172 points)
edited by
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 like 0 dislike
Hidden content!
#include<stdio.h>
int main()
{
    int array[1000][1000];
    int m, n, i, j, count=0;
* * * ** * *** *** **** ** * * * * * * * *** ***
** * ** ** * * ** ******
* * * ** ** **** ** * *** *** ** * ** ****
* ***** * * * ** * ** ** *** ** * * ***** * **** * ** * **** **** ***** *
    }
* *** * *** *** **** * * *
**** **** *** **** *** ** ** ** * **** * * *** **
* * *** * * * ** ***** ** * ** *** ** * * * *********** *
* **** ******* *** * * * ** ****** * * * ** * * ** * ** *
** * * * * * * ** *** ***** ** * * **
    }
** *** ** ******** ** * ** ** * * * *** * *
** *** *** * * * * ** * *
* * * *** * ** ****** *** ** ** * * *
*** *** * * ******* *** * * * ** *** ** **** * * *** * * ****
* * **** * *** ** * * ** *** * * ** ** ** **** ** *** ** * *** * * * ******** * **** * **** * ******
**** * *** ** * * * *** * *** * * * * * ** * * * *** *** *** *** * * * ** ** * * * * ** *
** ***** **** * ** * ***** * * * * *** ** * * ** *   
    } *** *** * * *** * **** **
    return 0;
}
answered by (144 points)
edited by
0 0
prog.c: In function 'main':
prog.c:5:5: error: expected ',' or ';' before 'int'
     int  m, n, i, j, count;
     ^~~
prog.c:6:19: error: 'm' undeclared (first use in this function)
     scanf("%d%d",&m,&n);
                   ^
prog.c:6:19: note: each undeclared identifier is reported only once for each function it appears in
prog.c:6:22: error: 'n' undeclared (first use in this function)
     scanf("%d%d",&m,&n);
                      ^
prog.c:7:9: error: 'i' undeclared (first use in this function)
     for(i=0;i<m;i++){
         ^
prog.c:8:12: error: 'j' undeclared (first use in this function)
        for(j=0;j<n;j++)
            ^
prog.c:14:11: error: 'count' undeclared (first use in this function)
           count++;
           ^~~~~
prog.c:25:5: error: 'returm' undeclared (first use in this function)
     returm 0;
     ^~~~~~
prog.c:25:12: error: expected ';' before numeric constant
     returm 0;
            ^
0 0
prog.c: In function 'main':
prog.c:25:5: error: 'returm' undeclared (first use in this function)
     returm 0;
     ^~~~~~
prog.c:25:5: note: each undeclared identifier is reported only once for each function it appears in
prog.c:25:12: error: expected ';' before numeric constant
     returm 0;
            ^
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 like 0 dislike
Hidden content!
#include<stdio.h>
int main()
{
    int x,y;
*** ** ******* * * * * *** %d",&x,&y);
    int i,j,arr[x][y],count=0;
***** * * ** ** ** * *
***** * * ** **** ** * **** ** * * ** *** *
*** *** **** * * * * * * ** ** * *
* * ** ** **** *** * **** ** * ** * * * * * * ** ** ** * *** **** * ***** ** **** ** * ** *** *
** ** * ** ******* ** * * * **** * *** ** * *** * *** ** * * *
* ** * * *** ** * ** ***** ** * ** * ** * * ** *** * * * ** * ** * * ** ** ** * * * * ***
* * *** * *** ******* * *
*** ** * ** * **** **** * ** ** %d %d\n",x,y,count);
** * *** ** * * **** ** * *** *
*** * * * * * * * * ****** * * ***** * * *** ** *** * *
* * * **** * * * ** * ***** * * ******** *
* * * * * * ** * * * * * ** *** *** * **** ** *** ***** * *** **** **** *
* ** ** * **** * *** ** ******* *** * ** * * ** * * ** * * * *** * ** ******* *** ** **** *** * %d %d\n",i,j,arr[i][j]);
**** * * * * * * * ** *** * * * *
    return 0;
}
answered by (100 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 like 0 dislike
Hidden content!
#include <stdio.h>

int main ()
{
    int sum=0,a,b,x,y;
* *** *** * ** * * ***** *** *** * * * **
** * ** *** ** ** * ** * ** ** * **
    int arr[a][b];
    for (x=0;x<a;x++)
**** ** * * * * * *** * * ** *** * * ***** * = 0;y<b;y++)
**** **** * ** * * * * * ** ** * * ** *** * *** * **
* * **** * * * **** * *** ** * * ** * ** * * * ** *** ***** ** * * * * * ** * * ****
*** * * **** *** ** *** * ** * *** * * *** * * ***** **
    for (x=0;x<a;x++)
* ** * ** * * **** * ** ** * *** * * * **** ** = 0;y<b;y++)
** *** ** *** ***** ** * *** ** * ** *** * * ***
* * * * * ** ** ** **** * **** * ******** * * ****** **** ** * ** *** * ** * ( arr[x][y] != 0 )
* * ************* *** * * ** * ** ** * * * * * * * ** * ***** *** = sum + 1;
* ** * ***** ** * ***** **** ***** * * ** * **** ****** ** *
** ** * ** * *** * ** * %d %d\n",a,b,sum);
* ** ** * ******* * (x=0;x<a;x++)
**** * * *** ** ** * * * * * = 0;y<b;y++)
**** * *** **** * * **** * *** * *** * * * ** * * *
** ** ** * * * ** ** *** * * ** * ***** * ** ****** * *** * ** ** * * * ***** *** ( arr[x][y] != 0 )
******* * *** * *** ** ** * ** * * **** * ** ** ** *** **** ** * * *** **** ** * * ** * * ** ** * * %d %d\n",x,y,arr[x][y]);
* ***** *** * * ** ** **** * ******** * * ** * *** * ***

* * * * * **** ** 0;
}
answered by (209 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.71.1.144
©2016-2025

Related questions

2 like 0 dislike
5 answers
[Exam] asked Dec 23, 2017 in 2017-1 程式設計(一)AD by 楊修俊 (30k points)
ID: 38942 - Available when: 2017-12-23 09:00 - Due to: 2017-12-23 12:10
| 1.5k views
2 like 0 dislike
18 answers
[Exam] asked Dec 23, 2017 in 2017-1 程式設計(一)AD by 楊修俊 (30k points)
ID: 38941 - Available when: 2017-12-23 09:00 - Due to: 2017-12-23 12:10
| 3.7k views
4 like 0 dislike
16 answers
[Exam] asked Dec 23, 2017 in 2017-1 程式設計(一)AD by 楊修俊 (30k points)
ID: 38940 - Available when: 2017-12-23 09:00 - Due to: 2017-12-23 12:10
| 6.3k views
3 like 0 dislike
16 answers
[Exam] asked Dec 23, 2017 in 2017-1 程式設計(一)AD by 楊修俊 (30k points)
ID: 38939 - Available when: 2017-12-23 09:00 - Due to: 2017-12-23 12:10
| 4.4k views
2 like 0 dislike
3 answers
[Normal] Coding (C) - asked Dec 20, 2017 in 2017-1 程式設計(一)AD by 楊修俊 (30k points)
ID: 38168 - Available when: Unlimited - Due to: Unlimited
| 996 views
12,783 questions
183,442 answers
172,219 comments
4,824 users