|2eM!x
Sep 20th, 2005, 08:40 PM
I know im not good...just trying to help :wave:
#include <iostream>
#include <string>
#include <ctime>
using namespace std;
void RndWord(long iLen){
char ch;
string mystr;
char i=0;
while (i < iLen){
ch = (rand()%(('Z'-'A'))+'A');
mystr += ch;
i++;
}
cout << mystr << "\n";
}
int main(void){
long lenword;
srand(time(NULL));
cout << "Word length?\n";
cin >> lenword;
RndWord(lenword);
return 0;
}
#include <iostream>
#include <string>
#include <ctime>
using namespace std;
void RndWord(long iLen){
char ch;
string mystr;
char i=0;
while (i < iLen){
ch = (rand()%(('Z'-'A'))+'A');
mystr += ch;
i++;
}
cout << mystr << "\n";
}
int main(void){
long lenword;
srand(time(NULL));
cout << "Word length?\n";
cin >> lenword;
RndWord(lenword);
return 0;
}