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 |
一看这题就知道打表水过,赶紧百度查表,贴码吧。。。/*2191 Accepted 168K 0MS C++ 877B 2011-01-26 21:20:13 */ #include<stdio.h> int main() { int n,i; int b[10]={11,23,29,37,41,43,47,53,59}; char a[10][80]={ "23 * 89 = 2047 = ( 2 ^ 11 ) - 1", "47 * 178481 = 8388607 = ( 2 ^ 23 ) - 1", "233 * 1103 * 2089 = 536870911 = ( 2 ^ 29 ) - 1", "223 * 616318177 = 137438953471 = ( 2 ^ 37 ) - 1", "13367 * 164511353 = 2199023255551 = ( 2 ^ 41 ) - 1", "431 * 9719 * 2099863 = 8796093022207 = ( 2 ^ 43 ) - 1", "2351 * 4513 * 13264529 = 140737488355327 = ( 2 ^ 47 ) - 1", "6361 * 69431 * 20394401 = 9007199254740991 = ( 2 ^ 53 ) - 1", "179951 * 3203431780337 = 576460752303423487 = ( 2 ^ 59 ) - 1"}; //freopen("2191.txt","r",stdin); while(scanf("%d",&n)!=EOF) { for(i=0;i<=9;i++){ if(n>b[i]) puts(a[i]); else break; } } //while(1); } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator