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 snowfall at 2008-05-19 22:04:57 on Problem 3094
In Reply To:Re:为什么Sample Input 和Sample Output都对,还是WA呢? Posted by:xinqing8712 at 2008-05-12 10:20:15
#include<iostream>
#include<string.h>
using namespace std;

int main()
{
     char a[200];
     gets(a);
     while(a[0]!='#')
     {
           long sum=0;
           for(int i=0;a[i]!='\0';i++)
           {
              if(a[i]>=65&&a[i]<=90) sum+=(i+1)*int(a[i]-64);
              if(a[i]>=97&&a[i]<=122) sum+=(i+1)*int(a[i]-96);
           } 
              printf("%d\n",sum);
              gets(a);
     }
     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