Added safegards against Windows

This commit is contained in:
Abreu 2021-09-29 10:27:44 -03:00
parent 7dfedc5ef0
commit 701c8314db
No known key found for this signature in database
GPG Key ID: 64835466FF55F7E1
3 changed files with 5 additions and 4 deletions

2
.gitignore vendored
View File

@ -1,3 +1,3 @@
*.out
2021/
!2021/0
!2021/0/

View File

@ -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;

View File

@ -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;
}