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

一直WA....高手们帮慢看哈!!.....谢谢哈

Posted by lxqlxq123 at 2011-03-19 13:14:52 on Problem 1488
#include <stdio.h>
#include <string.h>

int main(int argc, char *argv[])
{
  char a,b[100];
  int i=0, k=0, flag=0; 
  while(scanf("%c",&a)!=EOF){
  
      if(a != '\n'){
      
          if(a ==  '"'){ 
               if(flag == 0){     
  
                   b[k]='`';
                   b[++k]='`';
                   flag=1;
                   k++;
               }
               else {
                   b[k]='\'';
  		         b[++k]='\'';
 	               k++;
 	               flag=0;
               }
            }
 	      else{
		 
              b[k]=a;
		      k++;
		  }
      }
  	else
    {
		for(i=0;i<k;i++)
		{
            printf("%c",b[i]);
		}
		printf("\n");
		k=0;
    }
}
    	
  return 0;
}




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