Archived

This topic is now archived and is closed to further replies.

Penguinzchaseme

code problem

Recommended Posts

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[7], Group[7]; int n, x, y, z, a, b=1, c=1; cin>>UFO[7]; cin>>Group[7]; for(n=0; alpha[n];n++); { for(x=0;UFO[x];x++){ if(UFO[x]=alpha[n])UFO[x]=n+1; } for(y=0;Group[y];y++) if(Group[y]=alpha[n])Group[y]=n+1; } for(z=0;UFO[z];z++){ b=b*UFO[z]; } for(a=0;GroupLink

Share this post


Link to post
Share on other sites
to use cin to get qa character string i think you need something ala this:

cin.get( buffer, buffer_length );
//then you prolly want
cin.ignore( 80, ''\n'' );
cin.get( buffer2, buffer2_length );

hope this is what you meant

Share this post


Link to post
Share on other sites
You crossposted this 3 times and dont even ask a question!!!! wtf, here is a link to help you out...

http://directory.google.com/Top/Computers/Internet/Etiquette/?tc=1

Share this post


Link to post
Share on other sites
well, he used the variable 'a' as the subscript in an array, and presumably this board uses [+a+] to denote a link, hence mangled his post.

yeah crossposting = WTF?


[edited by - mictian on May 1, 2003 8:46:05 PM]

Share this post


Link to post
Share on other sites