ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1104. Don’t Ask Woman about Her Age

I get WA on test 1 !!!!!!! :((
Posted by Farhad Ghasemi 27 Jan 2008 22:51
I tested my program several times but I can't find what's wrong with it please help !
my program :


#include<iostream>
#include<stdio.h>
using namespace std;

int main()
{
    char a[1000000];
    cin>>a;
    int i;
    int counter=0;
    int maxint=0;
    for(i=0;i<strlen(a);i++)
    {
        if(a[i]>64){
            if(maxint<a[i]-55)
                maxint=a[i]-55;
            counter+=a[i]-55; }
        else {
        if(maxint<a[i]-48)
                maxint=a[i]-48;
            counter+=a[i]-48; }
    }
    for(i=1;i<36;i++)
    {
        if((counter%i==0)&&(maxint<i))
        {
            cout<<i+1;
            return 0;
        }
    }
    cout<<"No solution.";
    return 0;

}