Moved kattis from Uni repo
This commit is contained in:
16
kattis/problems/03_11_23/countthevowels/main.c
Normal file
16
kattis/problems/03_11_23/countthevowels/main.c
Normal file
@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char c;
|
||||
int vowels = 0;
|
||||
while ((c=getchar()) != '\n') {
|
||||
if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' ||
|
||||
c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U') {
|
||||
vowels++;
|
||||
}
|
||||
}
|
||||
|
||||
printf("%d\n", vowels);
|
||||
return 0;
|
||||
}
|
24
kattis/problems/03_11_23/eyeofsauron/main.c
Normal file
24
kattis/problems/03_11_23/eyeofsauron/main.c
Normal file
@ -0,0 +1,24 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
char c;
|
||||
int count = 0;
|
||||
int firstSide = 0;
|
||||
while ((c=getchar()) != '\n') {
|
||||
if (c == '(') {
|
||||
firstSide = count;
|
||||
count = 0;
|
||||
}
|
||||
if (c == '|') {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count == firstSide) {
|
||||
printf("correct\n");
|
||||
} else {
|
||||
printf("fix\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user