Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- main()
- {
- float y;
- int i,x,c,z,othersymbols;
- othersymbols = y = 0;
- int figures[10] = {0};
- while((c = getchar()) != EOF)
- {
- if(c >= '0' && c <= '9') { ++figures[c - '0']; ++y;}
- else othersymbols++;
- }
- printf("Y = %3.3f\n\n",y);
- y = 15/y;
- for(i = 0; i < 10; ++i) if (figures [i] > 0 ) figures[i] = figures[i]*y;
- for(i = 15; i > 0; --i)
- {
- for(z = 0; z < 10; ++z)
- {
- if(figures[z] >= i)printf(" . ");
- else printf(" ");
- }
- printf("\n");
- }
- for(i = 0; i < 10; ++i) printf(" %d ",i);
- printf("\n\nothersymbols = %d\n\n",othersymbols);
- system("PAUSE");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement