Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement