Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

getch() 和 getchar() 区别不仅是回不回显吧?大家来看看

Posted by threetree at 2008-08-23 01:41:41 on Problem 3349
这是我的Input的,奇怪的是用getchar()一切正常,但把getchar() 变成 getch() (其他都没变) 就不行了,以前都说getch()和getchar()只是前者不回显,后者要回显。看来不止吧,望大家解惑......
......
scanf("%d",&n);
ch=getchar();
for(k=1;k<=n;k++)
{
        for(i=0;i<6;)
        {
        a[i]=0;
        for(ch=getchar();ch>='0'&&ch<='9';ch=getchar())
        {
        a[i]*=10;
        a[i]+=ch-'0';             
        }
        m[k][0]+=a[i];
        i++;
        }
......

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator