Added safegards against Windows
This commit is contained in:
parent
7dfedc5ef0
commit
701c8314db
|
@ -1,3 +1,3 @@
|
||||||
*.out
|
*.out
|
||||||
2021/
|
2021/
|
||||||
!2021/0
|
!2021/0/
|
||||||
|
|
|
@ -13,7 +13,7 @@ int main(){
|
||||||
}
|
}
|
||||||
output = 'A' + 5 * (c - '0');
|
output = 'A' + 5 * (c - '0');
|
||||||
scanf("%c", &c);
|
scanf("%c", &c);
|
||||||
output += (c - '0');
|
output += c - '0';
|
||||||
if (output <= 'Z'){
|
if (output <= 'Z'){
|
||||||
printf("%c", output);
|
printf("%c", output);
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
int n = 0;
|
int n = 0;
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
for (scanf("%d\n", &n); n > 0; n--) {
|
for (scanf("%d\n", &n); n > 0; n--) {
|
||||||
while (scanf("%c", &c) && c != '\n') {
|
while (scanf("%c", &c) != EOF && !iscntrl(c)) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'D':
|
case 'D':
|
||||||
printf("Rolada tatica ninja.\n");
|
printf("Rolada tatica ninja.\n");
|
||||||
|
@ -24,9 +25,9 @@ int main () {
|
||||||
break;
|
break;
|
||||||
case 'A':
|
case 'A':
|
||||||
printf("Nem ferrando. Vou de agentes mesmo.\n");
|
printf("Nem ferrando. Vou de agentes mesmo.\n");
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
scanf(" ");
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue