HPU 1348: Find the number of numbers that satisfy the condition [water problem]

#include <iostream>
using namespace std;
int fun(int m){
	int n,i,j=0,k=0,b[2333]={0};
	for(i=3;i<=m;i++){
		n=i;
		int count=1;
		if(n%10==5) {count--; b[j]=n; j++;}
		n=n/10;
		if((n%10==5)&&count) {b[j]=n; j++;}
		i=i+2;  
	}
	if(b[0]==0) return k;
	if((b[0]!=0)) return j;
}
intmain()
{
	int a;
	cin>>a;
	cout<<fun(a)<<endl;
	return 0;
}

//The judgment is strange, but it passed

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324489256&siteId=291194637