Guest User

Arxel

a guest
Nov 9th, 2008
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.39 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.          main()
  4.          {
  5.          int koniec, liczba, suma_cyfr, a, b, c, ilosc;
  6.          
  7.  
  8.          printf("Podaj  liczbe 'koniec' = ");
  9.          scanf("%d",&koniec);
  10.          
  11.          do
  12.          {
  13.                
  14.          printf("Podaj  liczbe = ");
  15.          scanf("%d",&liczba);
  16.          
  17.                              if (!(liczba>0 || liczba<1000))
  18.                              {
  19.                              liczba = 100*a + 10*b + c;
  20.                              suma_cyfr = a + b + c;
  21.                              }
  22.          
  23.                                        else if (liczba < 0)
  24.                                        {
  25.                                             printf("Podales liczbe niedodatnia\n");
  26.                                         }
  27.                                         else if (liczba >999)
  28.                                         {
  29.                                              printf("Podales liczbe czterocyfrowa\n");
  30.                                              }
  31.                                              
  32.          }
  33.          while (liczba != koniec);
  34.          
  35.          printf("Koniec programu, gdyz podales liczbe wieksza badz rowna liczbie 'koniec'.\n");
  36.          printf("Ilosc elementow dwu i trzycyfrowych, ktorych suma cyfr jest nieparzysta = \n");
  37.          
  38.          
  39.          while(1);
  40.          }
  41.  
  42.  
Advertisement
Add Comment
Please, Sign In to add comment