[ create a new paste ] login | about

Link: http://codepad.org/IrNM7hbC    [ raw code | output | fork ]

C, pasted on Aug 30:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>
int schet(char* chislo);
int main()
{
    printf("%s",schet("13583"));
    getchar();
    return 0;    
}
int schet(char* chislo)
{
    int res=0,temp,i,size;
    size=sizeof(*chislo)/2;
    for(i=0;i<=size;i++)
    {
                        temp=(int)chislo[i];
                        if (temp%2!=0) res++;
    }
    return res;
}


Output:
1
Segmentation fault


Create a new paste based on this one


Comments: