Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

[HELP] C++


  • Please log in to reply
No replies to this topic

#1 n0l1f3r

n0l1f3r

  • Members
  • 3 posts
  • OFFLINE
  •  
  • Location:Estonia
  • Local time:11:37 AM

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;

}


BC AdBot (Login to Remove)

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users