Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- main()
- {
- int koniec, liczba, suma_cyfr, a, b, c, ilosc;
- printf("Podaj liczbe 'koniec' = ");
- scanf("%d",&koniec);
- do
- {
- printf("Podaj liczbe = ");
- scanf("%d",&liczba);
- if (!(liczba>0 || liczba<1000))
- {
- liczba = 100*a + 10*b + c;
- suma_cyfr = a + b + c;
- }
- else if (liczba < 0)
- {
- printf("Podales liczbe niedodatnia\n");
- }
- else if (liczba >999)
- {
- printf("Podales liczbe czterocyfrowa\n");
- }
- }
- while (liczba != koniec);
- printf("Koniec programu, gdyz podales liczbe wieksza badz rowna liczbie 'koniec'.\n");
- printf("Ilosc elementow dwu i trzycyfrowych, ktorych suma cyfr jest nieparzysta = \n");
- while(1);
- }
Advertisement
Add Comment
Please, Sign In to add comment