| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
这个代码还可以,3行,能AC。#include <iostream>
#include <map>
using namespace std;
int main ()
{
map < int, bool > NotSelf;
for ( int i = 1; i < 10000; i++ )NotSelf[ i / 1000 + ( i / 100 ) % 10 + ( i / 10 ) % 10 + i % 10 + i ] = 1;
for ( int i = 1; i < 10000; i++ )if ( !NotSelf[i] )printf( "%d\n", i );
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator