»
| | | | | |

» , : |
    
    
         ++
  [ ]
» " " «


<< >>
[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 ]
: paradise, KMA
  

tanyabar



. . . 8 . , , , , .


: 8 | : 2009 | : 30 2009 15:15 | IP
vanille




:
1) , ( );
2) .- , . . ;
3) ;
4) . n- , .
, )

: 9 | : 2009 | : 31 2009 9:52 | IP
liza frizorger





*_*
++
!!!!
, .


1. 0.2. , 0.
x,y n .
:
, r ;
.

. =/
r=3 , n=5.
r=3 1 :
x=4, y=3.
1/5 (20%).

3.9.

?
^_^

: 3 | : 2009 | : 3 2009 16:51 | IP
Kida




,,, p. ++, - . . , main : , 3- , , - . , , , . , , , . . , . . , 1 2, , . , " ", .... ,, ...
:
#include <fstream>
#include <iostream>//
#include <io.h>
#include <iomanip>
#include <conio.h>


using namespace std;
//

const int maxn=100; // ,
double getfloat ()
{
auto int key=0, i=0, point=0, signum=-1;
double float_num;
char num[7];
key=_getch();
do
{
if ((key==45)||(key==46)||(key==47)||(key==48)||(key==49)||(key ==50)||(key==51)||(key==52)||(key==53)||(key==54)||(key==54) ||(key==55)||(key==56)||(key==57))
{
num=key;
if (key!=13) cout<<num;
i++;
if(i==6) break;
if (key==46) point=1;
}
if (key==8)
{
cout<< "\b \b";
if (i>0) i--;
if (i==0) signum=-1;
if (i<=1) point=0;
};
key=_getch();
}
while ((key!=13)||(i==0));
num= '\0';
float_num=atof(num);
return float_num;
}

int ControlInCpp() // ++
{
char str[maxn];
int g;
do {
cin >> str;
g = -1;
g = atoi(str);
if (g<=0) cout << "Vvod nekorrekten! Povtorite ego: " << endl;
else break;
} while (true);
return g;
}

class AbstrClass //
{
virtual void Create(char *)=0; //
};

class MyTable:public AbstrClass //-
{
public: //
void Create(char *fname)
{
ofstream out(fname, ios::out); //
if (!out)
{
cerr << "/*Oshibka*/ sozdaniya faila!" << endl;
exit(1);
}
out.close();
}
};


void InCpp(char *fname) // C++
{
char marka[7], yadro[7];
double chast,proc, kash, shina, cena;//
ofstream out(fname, ios::app); //
/*if (!out)
{
cerr << "Oshibka!" << endl;
exit(1);
} */ // (CPP)
cout << "\n\t Vvedite dannie";
cout << " ";
cout << "\n Marca processora: ";
cin.getline(marka,7);
cout << "\n Chastota, GHz: ";
chast=getfloat();
cout << "\n Yadro: ";
cin.getline(yadro,7);
cout << "\n Teh. process: ";
proc=getfloat();
cout << "\n Kahs: ";
kash=getfloat();;
cout << "\n Shina, GHz: ";
shina=getfloat();
cout << "\n Cena, USD: ";
cena=getfloat();
out << ""<<marka<<" "<<""<<chast<<" "<<""<<yadro
<<" "<<""<<proc<<" "<<""<<kash<<" "
<<""<<shina<<" "<<""<<cena<<" "<<endl;
out.close();
}

void InC(char *fname) // C
{
char marka[7], yadro[7]; //, s[255];//
double chast,proc, kash, shina, cena;
ofstream out(fname, ios::app); //

//if (!out)
//{
// cerr << "Oshibka!" << endl;
// exit(1);
//}
// (C)
printf("\n\t Vvedite dannie");
printf("\n Marca processora: ");
gets_s(marka);
printf("\n Chastota, GHz: ");
chast=getfloat();
printf("\n Yadro: ");
gets_s(yadro);
printf("\n Teh. process: ");
proc=getfloat();
printf("\n Kahs: ");
kash=getfloat();
printf("\n Shina, GHz: ");
shina=getfloat();
printf("\n Cena: ");
cena=getfloat();
out << ""<<marka<<" "<<""<<chast<<" "<<""<<yadro
<<" "<<""<<proc<<" "<<""<<kash<<" "
<<""<<shina<<" "<<""<<cena<<" "<<endl;
out.close();
}

// (C++)
void outInCpp (char *marka, char *chast, char *yadro, char * proc, char * kash, char * shina, char * cena)
{
cout<<setiosflags(ios::left)<<setw(8)<<marka<<setw(14)<<chast <<setw(8)<<yadro<<setw(15)<<proc<<setw(7)<<kash<<setw(13) <<shina<<setw(12)<<cena<<""<<endl;
}

// ()
void outInC (char *marka, char *chast, char *yadro, char * proc, char * kash, char * shina, char * cena)
{
//
printf("%-8s",marka);
printf("%-14s",chast);
printf("%-8s",yadro);
printf("%-15s",proc);
printf("%-7s",kash);
printf("%-13s",shina);
printf("%-12s",cena);
printf("");
printf("\n");
}

void menu()
{
system("cls");
cout << "\n Programma osutchestvlyaet formatirovannyi vvod-vyvod dannyh.\n";
cout << "\n\t\t MENU" << endl;
cout << " 1. Vvod dannyh(C++)" << endl;
cout << " 2. Vvod dannyh(C)" << endl;
cout << " 3. Vyvod dannyh(C++)" << endl;
cout << " 4. Vyvod dannyh (C)" << endl;
cout << " 5. Vyhod" << endl;
cout << " \t Vyberite punkt menu: ";
}

void main ()
{
system("cls"); //
int /*ci,*/ch, was=0; //
char k, fname[256]/*ff[256];*//*string nm*/;
char y[2]="y",n[2]="n";
//FILE *fnameC;
int vvod = -1;
int q,w2=0;
char quit[2];
MyTable a; // MyTable
char marka[7], chast[13], yadro[7], proc[14], kash[6], shina[12], cena[11]; //

for (;;) //
{ int flag=0;
while(flag==0)
{
menu();
ch=_getch();
cout <<endl;
if ((ch<'1')||(ch>'6'))
{
cout <<"TAKOGO PUNKTA NE SUCHESTVUET!!!\n"
<<"NAJMITE LUBUYU KLAVISHU I POVTORITE VVOD.\n";
_getch();
system ("CLS");
}
else flag=1;
}
if (ch=='1') //1-
{

cout << "Vvedite imja fayla dlya zapisi: ";
gets_s(fname);
was=1;
do{
if (was==1)
{
if (was==0) a.Create(fname); //
InCpp(fname); // (C++)
was=1;
}
else cout << "Vy ne vveli imya faila! Vvedite ego!";
ifstream in(fname, ios::in); //
printf(" TABLICA XARAKTERISTIK PROCESSOROV:\n");
printf(" Ŀ\n ");
printf(" Marca Chastota,GHz Yadro Teh. process Kash Shina, GHz Cena \n");
printf(" Ĵ\n ");
while (in>>skipws>>marka>>skipws>>chast>>skipws>>yadro>>skipws >>proc>>skipws>>kash>>skipws>>shina>>skipws>>cena)
outInCpp(marka,chast,yadro,proc,kash,shina,cena);/// C++
printf(" \n ");
in.close();
printf("Prodolgit' vvod??? y/n \n");
k=_getch();
while((k!='y')||(k!='n')){k=' ';printf("try again\n"); k=_getch();
if((k=='y')||(k=='n'))break;}
system("CLS");
}while (k!='n');
}
if (ch=='2') //2-o
{
printf("Vvedite imja fayla dlya zapisi: ");
gets_s(fname);
was=1;
do{
if (was==1)
{
if (was==0) a.Create(fname); //
InC(fname); // (C++)
was=1;
//ControlInC();
}
else cout << "Vy ne vveli imya faila! Vvedite ego!";

ifstream in(fname, ios::in); //
printf(" TABLICA XARAKTERISTIK PROCESSOROV:\n");
printf(" Ŀ\n ");
printf(" Marca Chastota,GHz Yadro Teh. process Kash Shina, GHz Cena \n");
printf(" Ĵ\n ");
while (in>>skipws>>marka>>skipws>>chast>>skipws>>yadro>>skipws >>proc>>skipws>>kash>>skipws>>shina>>skipws>>cena)
outInC(marka,chast,yadro,proc,kash,shina,cena);/// C
printf(" \n ");
in.close();
printf("Prodolgit' vvod??? y/n \n");
k=_getch();
while((k!='y')||(k!='n')){k=' ';printf("try again\n"); k=_getch();
if((k=='y')||(k=='n'))break;}
system("CLS");
}while (k!='n');
}
if (ch=='3') //3-
{
do
{
do
{
cout << "Vvedite imja fayla dlya chteniya: ";
cin>>fname;
q = _open(fname, ios::in);
if (q==-1)
{
w2=0;
printf("Takogo faila net!!!!\n");
cout<<"Exit to menu? y/n\n";
do
{
cin>>quit;
if(strcmp(y,quit)==0)
w2=1;
else
if(strcmp(n,quit)==0)
{
w2=0;
}
else w2=2;
}
while(w2==2);
}
else w2=1;
}
while( (w2!=1) );
was=0;
if(q!=-1)
was=1;
if(was==1)
{
ifstream in(fname, ios::in); //
printf(" TABLICA XARAKTERISTIK PROCESSOROV:\n");
printf(" Ŀ\n ");
printf(" Marca Chastota,GHz Yadro Teh. process Kash Shina, GHz Cena \n");
printf(" Ĵ\n ");
while (in>>skipws>>marka>>skipws>>chast>>skipws>>yadro>>skipws >>proc>>skipws>>kash>>skipws>>shina>>skipws>>cena)
outInC(marka,chast,yadro,proc,kash,shina,cena);/// C
printf(" \n ");
in.close();
_getch();
}
w2=1;
}
while (w2==0);
}
if (ch=='4') //4-
{
do
{
do
{
cout << "Vvedite imja fayla dlya chteniya: ";
cin>>fname;
q = _open(fname, ios::in);
if (q==-1)
{
w2=0;
printf("Takogo faila net!!!!\n");
cout<<"Exit to menu? y/n\n";
do
{
cin>>quit;
if(strcmp(y,quit)==0)
w2=1;
else
if(strcmp(n,quit)==0)
{
w2=0;
}
else w2=2;
}
while(w2==2);
}
else w2=1;//if (w2=1) {break;}
}
while( (w2!=1) );
//else exit(0);
was=0;
if(q!=-1)
was=1;
// if (was==0) cout << "Vi ne vveli dannie! Vedite ih!";
if(was==1)
{
ifstream in(fname, ios::in); //
printf(" TABLICA XARAKTERISTIK PROCESSOROV:\n");
printf(" Ŀ\n ");
printf(" Marca Chastota,GHz Yadro Teh. process Kash Shina, GHz Cena \n");
printf(" Ĵ\n ");
while (in>>skipws>>marka>>skipws>>chast>>skipws>>yadro>>skipws >>proc>>skipws>>kash>>skipws>>shina>>skipws>>cena)
outInC(marka,chast,yadro,proc,kash,shina,cena);/// C
printf(" \n ");
in.close();
_getch();
}



w2=1;
}
while (w2==0);
}
if (ch=='5') exit(0);
// _getch();
}

}





// {
///* for(ci=0;ci<256;ci++)
// {
// ff[ci]='\n';
// }
//*/
// do
// {
//// vvod = -1;
// do
// {
// cout << "Vvedite imja fayla dlya chteniya: ";
// cin>>fname;
// q = _open(fname, ios::in);
// //scanf("%s",fname);
// //fnameC = fopen(fname,"r");
// if ((int)fnameC==-1)
// {
// w2=0;
// printf("Takogo faila net!!!!\n");
// printf("Exit to menu? y/n\n");
// do
// {
// scanf("%d",&quit);
// if(strcmp(y,quit)==0)
// w2=1;
// else
// if(strcmp(n,quit)==0)
// {
// w2=0;
// }
// else w2=2;
// }
// while(w2==2);
// //else {vvod= 1;}
// }
// else w2=1;//if (w2=1) {break;}
// }
// while( (w2!=1) );
// //else exit(0);
// was=0;
// if(q!=-1)
// was=1;
//// if (was==0) cout << "Vi ne vveli dannie! Vedite ih!";
// if(was==1)
// {
////// ifstream in(fname, ios::in); //
//// printf(" TABLICA XARAKTERISTIK PROCESSOROV:\n");
//// printf(" Ŀ\n ");
//// printf(" Marca Chastota,GHz Yadro Teh. process Kash Shina, GHz Cena \n");
//// printf(" Ĵ\n ");
////// while (in>>skipws>>marka>>skipws>>chast>>skipws>>yadro>>skipws >>proc>>skipws>>kash>>skipws>>shina>>skipws>>cena)
//// fscanf(fnameC,ff);
//// for(ci=0;ci<2;ci++)
//// printf("%s",ff[ci]);
////// outInC(marka,chast,yadro,proc,kash,shina,cena);/// C
//// printf("\n");
//// printf(" \n ");
//// fclose(fnameC);
//// _getch();
// }






/* do
{
cout<<"Exit to menu? y/n\n";
cin>>quit;
if(strcmp(y,quit)==0)
w2=1;
else
if(strcmp(n,quit)==0)
{
w2=0;
q=0;
}
else w2=2;
}
while(w2==2);
*/



/*const int maxn=20; // ,

int ControlInC() //
{
char str[maxn];
int g;
do {
gets_s(str);
g = -1;
g = atoi(str); // int
if (g<=0) printf("Vvod nekorrekten! Povtorite ego: ");
else break;
} while (true);
return g;
}*/




:
if (ch=='3') //3-
{
do
{
do
{
cout << "Vvedite imja fayla dlya chteniya: ";
cin>>fname;
q = _open(fname, ios::in);
if (q==-1)
{
w2=0;
printf("Takogo faila net!!!!\n");
cout<<"Exit to menu? y/n\n";
do
{
cin>>quit;
if(strcmp(y,quit)==0)
w2=1;
else
if(strcmp(n,quit)==0)
{
w2=0;
}
else w2=2;
}
while(w2==2);
}
else w2=1;
}
while( (w2!=1) );
was=0;
if(q!=-1)
was=1;
if(was==1)
{
ifstream in(fname, ios::in); //
printf(" TABLICA XARAKTERISTIK PROCESSOROV:\n");
printf(" Ŀ\n ");
printf(" Marca Chastota,GHz Yadro Teh. process Kash Shina, GHz Cena \n");
printf(" Ĵ\n ");
while (in>>skipws>>marka>>skipws>>chast>>skipws>>yadro>>skipws >>proc>>skipws>>kash>>skipws>>shina>>skipws>>cena)
outInC(marka,chast,yadro,proc,kash,shina,cena);/// C
printf(" \n ");
in.close();
_getch();
}
w2=1;
}
while (w2==0);
}

P.S., .
!!

: 2 | : 2009 | : 29 2009 0:02 | IP
sebastiano m




. , .

, 5 . , : 1 ., ., , , .

: 2 | : 2009 | : 13 . 2009 18:33 | IP
sebastiano m




, ???

: 2 | : 2009 | : 14 . 2009 21:50 | IP
Holden



, , ( ) . , .

: 2 | : 2009 | : 21 . 2009 12:58 | IP
lolth



:
http://magegame.ru/?rf=e3e0e7eeedeeeaeef1e8ebeae0

: 24 | : 2009 | : 25 . 2009 19:01 | IP
Leka




""
: . . 1- 7 11 ; 2, 3 12-; 4, 5, 6, 8, 9, 10- . , , , 7.
... , ... ....

: 1 | : 2009 | : 26 . 2009 16:43 | IP
22032203



!!!!!
++ ...
:
n 2n , 2

: 1 | : 2009 | : 4 . 2009 14:49 | IP

:
  ?
  ?

HTML

IkonCode

?
e-mail?
?
?  
 


<< >>
[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 ]

© Ikonboard.com