FLAMES[c++]
+2
romgatchalian
deathrowcore
6 posters
Page 1 of 1
FLAMES[c++]
FLAMES children game ^^ pang bata
compiler --> mind ^^
i dont have compiler, where can i get Turbo C++ 4.5?
- Spoiler:
- #include<iostream.h>
#include<string.h>
#include<conio.h>
int main()
{
int count=0,i,k,j,y,x,z;
char girl[80],boy[80],boy2[80],girl2[80],c,a='y';
/*the while statement here will make the program flexible*/
while((a=='y')||(a=='Y'))
{
count =0;
cout << "Characters,White Spaces and Dotes are onLy accepted here to get a correct output" << endl;
cout << "Boy:";
cin.getline(boy,80);//gets the name for the boy as a string character includes spaces
cout << "Girl:";
cin.getline(girl,80);//gets the name for the girl as a string character includes spaces
strcpy(boy2[80],boy[80]);//copies the string of the boy to boy2
strcpy(girl2[80],girl[80]);//copies the string of the boy to girl2
x=strlen(boy[80]);//counts the character including spaces and dotes
y=strlen(girl[80]);
strcat(boy2[80],girl2[80]);//concatinates the string boy2 and string girl2 returning the concatinated string @ boy2
//concatination means joining
z=strlen(boy2[80]);//counts the length of the concatinated string
/*the following nested loop will compare and count the same letters of the two strings(girl,boy)and concatinated string boy2
as well as the white spaces and dotes.
*/
for(i=0;i<y;i++)
{
for(j=0;j<y;j++)
{
if(boy[i]==girl[j])
{
c=boy[i];
for(k=0;k<z;k++)
{
if(c==boy2[80])
{
boy2[k]=='/';
count++;
}
}
}
}
}
/*eliminates the counted dote and white spaces from the original strings
this will make the counting of similar letters only counted*/
for(i=0;i<x;i++)
{
if((boy[i]=='.')||(boy[i]==' '))
count--;
}
for(j=0;j<y;j++)
{
if((girl[j]=='.')||(girl[j]==' '))
count--;
}
cout << "Result:";
/*filters the while loop into lowest so the switch statement can define if it is
Friends
Lovers
Angry
Married
Enemy
Sweet
*/
while(count>5)
count-=6;
/*displays the output of the program*/
switch(count)
{
case 0:
cout << "Friends";
break;
case 1:
cout << "Lovers";
break;
case 2:
cout << "Anger";
break;
case 3:
cout << "Married";
break;
case 4:
cout << "Enemy";
break;
case 5:
cout << "Sweet";
break;
default:
break;
}
cout << "Do you wish to continue? Y/N";
a=getch();//if the user inputs a wrong single character, the program will exit
}
cout << "End of the Program.";
}
compiler --> mind ^^
i dont have compiler, where can i get Turbo C++ 4.5?
Last edited by deathrowcore on Mon Nov 23, 2009 11:03 am; edited 3 times in total
deathrowcore- Newbie
-
Posts : 17
Age : 31
Joined date : 2009-10-29
Location : pampanga
Cash : 26489
Re: FLAMES[c++]
mmh... what's that dude?
XED- Global Moderator
-
Posts : 6137
Age : 113
Joined date : 2009-10-22
Location : sa bag mo :]]
Cash : 31062
Re: FLAMES[c++]
tsktsk..
its hard to compile..
i have the compiler.. but i can't copy the code from this page to
turbo c..
if u already have the compiler..
its better if u'll post here the print screen of that output.. ^^
its hard to compile..
i have the compiler.. but i can't copy the code from this page to
turbo c..
if u already have the compiler..
its better if u'll post here the print screen of that output.. ^^
jhennyz- DPC Addict
-
Posts : 148
Age : 31
Joined date : 2010-03-04
Location : ~NOWHERETOFiND~
Cash : 26496
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|