51nod1413 权势二进数

一道水的不能再水的题目

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
inline int read(){
	int x=0,f=1,ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int main(){
	int n=read(),ans=0;
	while(n) ans=max(ans,n%10),n/=10;
	printf("%d\n",ans);
	return 0;
}

  

posted @ 2018-11-24 10:45  古城独钓  阅读(97)  评论(0)    收藏  举报