Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main() {
- int nr_seriale, cod_serial, k = 0, i, j, stare;
- long long int x = 0, putere = 1, aux;
- float rap, ep_vazute, ep_total;
- scanf("%d", &nr_seriale);
- for (i = 1; i <= nr_seriale; i++)
- {
- scanf("%d%f%f", &cod_serial, &ep_vazute, &ep_total);
- while (cod_serial != 0)
- {
- putere=12 * putere;
- cod_serial--;
- }
- rap = round((ep_vazute / ep_total) * 10);
- // rap = (ep_vazute / ep_total) * 10;
- // if ((int)((rap * 10)) % 10 >= 5) stare=(int)(rap) + 1;
- // else
- stare=(int)(rap);
- printf("%d%f\n", stare, rap);
- x = x + putere*(stare +1 );
- putere = 1;
- }
- aux = x;
- for (j = 10; j>=0; j--)
- {
- aux = x;
- for (i = 1; i <= nr_seriale; i++)
- {
- int k = 0;
- if (j == 0) {
- while (aux != 0) {
- if(aux % 12 != 0)
- printf("%d ", k);
- aux = aux / 12;
- k++;
- }
- }
- while(aux != 0) {
- if (aux % 12 != 0) {
- if (aux % 12 >= j + 1)
- printf("* ");
- else
- printf(". ");
- }
- aux = aux / 12;
- }
- }
- printf ("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement