Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(){
- int n;
- scanf("%d", &n);
- char milan1, milan2;
- char marko1, marko2;
- int partii_milan = 0, partii_marko = 0;
- for(int i = 0; i < n; i++){
- // scanf("%c", &milan1); // ako ne ni se citaat od tastatura ko sto treba
- scanf("%c %c %c %c" , &milan1, &milan2, &marko1, &marko2);
- int milan = 0;
- if(milan1 == 'J') {
- milan += 12;
- }
- else if(milan1 == 'Q') {
- milan += 13;
- }
- else if(milan1 == 'K') {
- milan += 14;
- }
- else {
- milan += 15;
- }
- if(milan2 == 'J') {
- milan += 12;
- }
- else if(milan2 == 'Q') {
- milan += 13;
- }
- else if(milan2 == 'K') {
- milan += 14;
- }
- else {
- milan += 15;
- }
- int marko = 0;
- if(marko1 == 'J') {
- marko += 12;
- }
- else if(marko1 == 'Q') {
- marko += 13;
- }
- else if(marko1 == 'K') {
- marko += 14;
- }
- else {
- marko += 15;
- }
- if(marko2 == 'J') {
- marko += 12;
- }
- else if(marko2 == 'Q') {
- marko += 13;
- }
- else if(marko2 == 'K') {
- marko += 14;
- }
- else {
- marko += 15;
- }
- if(milan > marko) {
- printf("Milan\n");
- partii_milan++;
- }
- else if(milan < marko) {
- printf("Marko\n");
- partii_marko++;
- }
- else {
- printf("Neresheno\n");
- }
- }
- printf("%d %d\n", partii_milan, partii_marko);
- return 0;
- }
- /*
- 2
- J J K Q
- A K Q K
- **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement