Advertisement
sellmmaahh

OR-2005-zad2

Aug 10th, 2015
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int izbroji (char *p) {
  5.     int br_znakova=0;
  6.     while (*p!='\0') {
  7.             if (*p>='0' && *p<='9') br_znakova++;
  8.     p++;
  9.     }
  10.     return br_znakova;
  11. }
  12. int main () {
  13.     int n;
  14.     char x[]="020-A-234";
  15.     n=izbroji(x);
  16.     printf("%d",n);
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement