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