Original Post
This code multiplies the number of each letter in a string(a=1 z=26) and checks to see if the modulus of each string divided by 47 is equal.
#include <iostream>
using namespace std;
int main()
{
char alpha[27]="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char *UFO, *Group;
int n, b=1, c=1;
cin>>*UFO;
cin>>*Group;
for(n=0; alpha[n];n++);
{
while(*UFO){
if(*UFO=alpha[n])*UFO=n+1;
else UFO++;
}
while(*Group){
if(*Group=alpha[n])*Group=n+1;
else Group++;
}
}
while(*UFO){
b=b*(*UFO);
UFO++;
}
while(*Group){
c=c*(*Group);
Group++;
}
if((b%47)==(c%47)){
cout<<"Go";
}
else cout<<"Stay";
return 0;
}
but it only allows me to input the first string(*UFO)-any ideas?
[edited by - Penguinzchaseme on April 30, 2003 11:18:55 PM]