题库 信息学奥赛题库 题目列表 NOIP2006年第十二届普及组初赛阅读程序写结果:#inclu...
填空题

NOIP2006年第十二届普及组初赛阅读程序写结果:

#include <iostream.h> 
#include <iomanip.h> 
void digit(long n,long m) 
  {if(m>0) 
      cout <<setw(2)<<n%10; 
   if(m>1) 
      digit(n/10,m/10); 
   cout <<setw(2)<<n%10; 
  } 
void main() 
 {long x,x2; 
  cout <<"Input a number:"<<endl; 
  cin >>x; 
  x2=1; 
  while(x2<x)  x2*=10; 
  x2/=10; 
  digit(x,x2);
  cout <<endl; 
 }

输入:9734526  

输出:___________

题目信息
阅读程序 2006年 初赛
-
正确率
0
评论
111
点击