Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main ()
- {
- int z;
- scanf("%d",&z);
- int a,b;
- int brSite=0;
- int brEdnakvo=0;
- int zbir = 0;
- float percent;
- while (1){
- scanf("%d%d", &a,&b);
- if(a==0 && b==0)
- break;
- brSite++;
- zbir=a+b;
- if(zbir==z)
- brEdnakvo++;
- }
- percent=(brEdnakvo * 100.0)/ brSite;
- printf("Vnesovte %d parovi chij zbir e: %d\n",brEdnakvo,z);
- printf("Procentot na parovi so zbir %d e: %.2f%%", z, percent);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement