BleepingComputer.com: [HELP] C++

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[HELP] C++ How to set numbers descending line up?

#1 User is offline   n0l1f3r 

  • New Member
  • Pip
  • Find Topics
  • Group: Members
  • Posts: 3
  • Joined: 16-July 08
  • Location:Estonia

Posted 05 November 2008 - 01:50 AM

i need VF in text file numbers are descending line up...
if any1 can help ill be glad...

#include <ctime> 
#include <cstdlib>
#include <iostream> 
#include <stdio.h>
#include <string.h>
#include <cstring>

using namespace std;
int n, Q , index2;
int main() 

{ 
FILE *SF,*VF;
SF = fopen("Sisend.txt","w");
fprintf(SF,"//Kodutoo 4\n");
fprintf(SF,"//Ainar Õun\n");
fprintf(SF,"//AA-41\n");
fprintf(SF,"//3.11.2008\n");
fprintf(SF,"\n");
fprintf(SF,"//Suvalised NUMBIRD ON:\n");
VF= fopen ("Valjund.txt", "w");
fprintf(VF,"//Kodutoo 4\n");
fprintf(VF,"//Ainar Õun\n");
fprintf(VF,"//AA-41\n");
fprintf(VF,"//3.11.2008\n");
fprintf(VF,"\n");
fprintf(VF,"//Järjekooras olevad nr-d on:\n");

	srand((unsigned)time(0));				  //here generates random numbers
	int lowest=100, highest=200; 
	int range=(highest-lowest)+1; 
  
   
	for(int index=0; index<20; index++){ 
	   Q = lowest+int(range*rand()/(RAND_MAX + 1.0)); 
		 cout << Q << endl;
		 fprintf (SF,"%d\n",Q);
	 
		fprintf (VF,"%d\n",Q); 

	 
 FILE *SF,*VF;
SF = fopen("Sisend.txt","w");
VF = fopen ("Valjund.txt", "w");
fclose(VF);
	} 


	
	system("PAUSE");
	return EXIT_SUCCESS;

}


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users