RieqyNS13 icon

Untitled

RieqyNS13 | PRO | 10/25/13 03:50:59 PM UTC | 0 ⭐ | 314 👁️ | Never ⏰ | []
C++ |

310 B

|

None

|

0 👍

/

0 👎

#include <iostream>
#include <stdlib.h>
#include <string.h>
using namespace std;
int main(){
    char b[13], *tmp;
    int len, count=0;
    for(int a=1; a<=100; a++){
        itoa(a, b, 10);
        len=strlen(b);
        for(int c=0; c<len; c++){
            tmp=b[c];
            if(!strcmp(tmp, "5"))count++;
            }
    }
    cout<<count;
    return 0;
}

Comments