Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(int argc, char** argv) {
- int broj, rastuci=0, opadajuci=0;
- printf("broj: ");
- scanf("%d", &broj);
- if (broj<0) broj=-broj;
- while (broj >= 10) {
- if (broj%10 < broj%100/10) opadajuci=1;
- else if (broj%10 > broj%100/10) rastuci=1;
- broj /= 10;
- }
- if (rastuci == opadajuci) printf("cifre nisu u strogom poretku\n");
- else if (rastuci == 1) printf("strogo rastuci poredak");
- else printf("strogo opadajuci poredak");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement