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 count = 0;
- int totCount = 0;
- while(scanf("%d %d", &a, &b)) {
- if (a == 0 && b == 0) {
- break;
- }
- if (a+b == z) {
- count++;
- }
- totCount++;
- }
- printf("Vnesovte %d paovi od broevi chij zbir e %d\n", count, z);
- float percentage = (float)(count*100) / totCount;
- printf("Procentot na parovi so zbir %d e %.2f%%\n", z, percentage);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement