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

谁帮偶看一下呀!!,偶已经错了几十次了呀!!实在是郁闷了,打算放弃了!!

Posted by ecjtubaowp at 2007-01-14 02:32:40 on Problem 1488
#include<stdio.h>
int main()
{
 int i,j,k,m,n;
 int flag=0;
 char a[1000],c;
 i=0;
 //c=getchar();
 while((c=getchar())!=EOF)
 {
  if(c!='\n')
  {
    if(c=='"')
    {
     if(flag==0)
    {
     a[i]='`';
     a[++i]='`';
     flag=1;
     i++;
    }
    else
    {
     a[i]='\'';
     a[++i]='\'';
     //a[i]=c;
     i++;
     flag=0;
    }
  }//if
  
    else 
    {
    a[i]=c;
    i++;
    }
  }
  else 
  {
   for(j=0;j<i;j++)
   printf("%c",a[j]);
   printf("\n");
   i=0;
  }
 
 }
}//main

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