Submission #37822568
Source Code Expand
#include<stdio.h>
int main(void)
{
int n;
scanf("%d",&n);
char moji[n+1][11];
if(n>=2)
{
for(int i=1;i<=n+1;i++)
{
scanf("%s",moji[i]);
}
printf("%s\n",moji[n]);
n=n-1;
while(n>=0)
{
printf("%s\n",moji[n]);
n--;
}
}
if(n==1)
{
scanf("%s",moji[1]);
printf("%s",moji[1]);
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Sequence of Strings |
| User | beelucario |
| Language | C (GCC 9.2.1) |
| Score | 100 |
| Code Size | 347 Byte |
| Status | AC |
| Exec Time | 4 ms |
| Memory | 1632 KiB |
Compile Error
./Main.c: In function ‘main’:
./Main.c:5:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
5 | scanf("%d",&n);
| ^~~~~~~~~~~~~~
./Main.c:11:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
11 | scanf("%s",moji[i]);
| ^~~~~~~~~~~~~~~~~~~
./Main.c:23:4: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
23 | scanf("%s",moji[1]);
| ^~~~~~~~~~~~~~~~~~~
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 02_max_00.txt, 02_max_01.txt, 02_max_02.txt, 03_min_00.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 4 ms | 1568 KiB |
| 00_sample_01.txt | AC | 1 ms | 1620 KiB |
| 01_random_00.txt | AC | 1 ms | 1504 KiB |
| 01_random_01.txt | AC | 1 ms | 1632 KiB |
| 01_random_02.txt | AC | 2 ms | 1500 KiB |
| 01_random_03.txt | AC | 2 ms | 1496 KiB |
| 01_random_04.txt | AC | 1 ms | 1560 KiB |
| 02_max_00.txt | AC | 1 ms | 1560 KiB |
| 02_max_01.txt | AC | 1 ms | 1568 KiB |
| 02_max_02.txt | AC | 1 ms | 1572 KiB |
| 03_min_00.txt | AC | 1 ms | 1564 KiB |