E D R S I H C RSS
ID
Password
Join
There is no fear in love; but perfect love casteth out fear.

FrontPage 1000개의랜덤한알파벳생성

#include <iostream>
#include <fstream>
#include <ctime>
#include <cstdlib>
using namespace std;

void process();


int main() {
    process();
    return 0;
}

void process() {
    fstream target_fp;
    target_fp.open("input1.txt",ios::out);
    
    srand(time(NULL));
    
    int count = rand()%10 + 1;
    int i = 0, j = 0;
    char tCh;
    
    target_fp << count << endl;
    
    
    
    for ( i = 0; i < count; i++) {
      for ( j = 0; j < 1000; j++ ) {
        tCh = 'A' + rand()%26;
        target_fp << tCh;
      }
      target_fp << endl;
    }
    
    
    target_fp.close();
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2013-05-21 01:51:13
Processing time 0.0322 sec