Advertisement
Guest User

Untitled

a guest
Dec 11th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.84 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5.  main()
  6. {
  7.        
  8.     float y;
  9.     int i,x,c,z,othersymbols;
  10.  
  11.     othersymbols = y = 0;
  12.     int figures[10] = {0};
  13.    
  14.     while((c = getchar()) != EOF)
  15.    {
  16.       if(c >= '0' &&  c <= '9') { ++figures[c - '0']; ++y;}
  17.       else othersymbols++;
  18.    }    
  19.    printf("Y = %3.3f\n\n",y);  
  20.    y = 15/y;
  21.    
  22.     for(i = 0; i < 10; ++i) if (figures [i] > 0 ) figures[i] = figures[i]*y;
  23.  
  24.  
  25.  
  26.  
  27.     for(i = 15; i > 0; --i)
  28.     {
  29.           for(z = 0; z < 10; ++z)
  30.          {
  31.             if(figures[z] >= i)printf(" . ");    
  32.             else printf("   ");    
  33.          }
  34.        printf("\n");  
  35.     }  
  36.  
  37.     for(i = 0; i < 10; ++i) printf(" %d ",i);  
  38.  
  39.    printf("\n\nothersymbols = %d\n\n",othersymbols);
  40.  
  41.    system("PAUSE");
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement