Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- int daLiJeMalo(char c) {
- return ((c >= 'a' && c <= 'z')); }
- main() {
- char c;
- char str[2048];
- int imaSlova = 0;
- int ind = 0;
- char preth;
- int pretInd;
- int rastuci = 1;
- while((c = getchar()) != '.') {
- str[ind] = c;
- ind++;
- }
- for(int i = 0; i<ind; i++) {
- if(!isdigit(str[i]) && daLiJeMalo(str[i])) imaSlova = 1;
- }
- if(imaSlova) printf("Ima malih slova abecede \n");
- else printf("Nema malih slova abecede \n");
- for(int i = 0; i<ind; i++) {
- if(!isdigit(str[i]) && daLiJeMalo(str[i])) {
- //ne znam b drugu stavku
- }
- }
- for(int i = 0; i<ind; i++) {
- if(!isdigit(str[i]) && daLiJeMalo(str[i])) {
- preth = str[i];
- pretInd = i;
- break;
- }
- }
- for(int i = pretInd+1; i<ind; i++) {
- if(!isdigit(str[i]) && daLiJeMalo(str[i])) {
- if(str[i] < preth || str[i] > preth+1)rastuci = 0;
- else preth = str[i];
- }
- }
- if(rastuci) printf("Sva slova su poredjana po abecedi \n");
- else printf("Slova nisu poredjana po abecedi \n");
- system("PAUSE");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement