您的位置:首页 > 其它

while (scanf("%d",&n)!=EOF)

2012-10-07 19:58 405 查看
// scanEOF.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
 
int main()   
{   
 int n;
 int array[25];   
 while (scanf("%d",&n)!=EOF)   
 {    
  for (int i=0; i<n; i++)   
   scanf("%d",array+i);   
   for ( i=0; i<n; i++)   
   printf ("%d ",array[i]);   
}  
 printf ("EOF:%d \n",EOF);   
  return 0;   
}
/*
^Z
EOF:-1
Press any key to continue
*/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: