Advertisement
Guest User

Untitled

a guest
Jan 24th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. #include<iostream>
  2. #include<stdio.h>
  3. #include<cstdlib>
  4. #include<cstring>
  5. #include<iomanip>
  6. #include<windows.h>
  7. using std::setw;
  8.  
  9. using namespace std;
  10.  
  11. void UserPass( char pass[],char username[] ,const int n,const int m){
  12.  
  13. cout<<"\nUsername: ";
  14. cin>>username;
  15.  
  16.  
  17. fflush(stdin);
  18. cout<<"\nPassword: ";
  19. cin>>pass;
  20. }
  21.  
  22. void Scelta(char pass[], char username [],const int n,const int m ){
  23. fflush(stdin);
  24. char scelta;
  25. cout<<"\nVuoi salvare la tua pass e user in .txt? Y o N: ";
  26. cin>>scelta;
  27.  
  28. switch(scelta){
  29. case 'Y':
  30. case 'y':
  31. cout<<"\nAcquisizione dati...\n";
  32. Sleep(3000);
  33. FILE *fp;
  34. fp=fopen("Salvataggio.txt","w");
  35.  
  36. if(fp==NULL){
  37. cout<<"Errore apertura file!";
  38. }
  39. fprintf(fp," ____________FACEBOOK-DEV 2.0__________ \n");
  40. fprintf(fp, "La tua username: ");
  41.  
  42. fprintf(fp,"%s",username);
  43.  
  44. fclose(fp);
  45. FILE *fp1;
  46. fp1=fopen("Salvataggio.txt","a");
  47. if(fp1==NULL){
  48. cout<<"Errore apertura file!";
  49. }
  50. fprintf(fp1, "\nLa tua password: ");
  51. fprintf(fp1,"%s",pass);
  52.  
  53. fprintf(fp1,"\n ______NON RISPONDERE A QUESTA MAIL- AUTOMATICA______ \n");
  54. fclose(fp1);
  55. cout<<"\nControlla nella cartella!!! "<<endl;
  56. Sleep(2000);
  57.  
  58. break;
  59.  
  60. default:
  61. cout<<"Grazie per averci scelto!! ";
  62. break;
  63. }
  64. }
  65.  
  66.  
  67. int main () {
  68. const int n=40;
  69. const int m=40;
  70. char pass[m],username[n];
  71.  
  72. cout<<" ______________FACEBOOK-DEV 2.0______________ \n";
  73. cout<<"\nDigita 10 cartteri per User - 8 caratteri per Pass ";
  74. UserPass(pass,username,n,m);
  75. Scelta(pass,username,n,m);
  76. return 0;
  77.  
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement