Patalpinti
Profilis
Naujausi
Geriausi
Komentuojami
Nepatikrinti
2012-05-21,
Fuck.It
21
komentarai (
3
)
Prisiminti vardą
Komentaras
Anonimas
prieš 4574 d.
#1
idomu mums cia zinot?!
Anonimas
prieš 4576 d.
Oho tu kietas...
Anonimas
prieš 4576 d.
// programos pavadinimas
#include <fcntl.h>
#include <io.h>
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
int main ()
{
ifstream fd("duomenys1.txt"); ofstream fr("resultatai1.txt");
int a, a2, f2, f, m, m2, i, n;
fr << "bandymu rezultatai:"<<endl;
fr << "--------------------------"<<endl;
fr << " a" << " f" << " m" << endl;
fr << "--------------------------" << endl;
fd >> n;
for (i = 1; i<=n; i= i+1){
fd >> a;
fd >> f;
fd >> m;
if (m== 0)
{m2 = f / a;fr << " "<< a<< " "<< f << " "<< m2<< endl; }
else if (f== 0)
{f2 = m * a; fr << " "<< a<< " "<< f2 << " "<< m<< endl; }
else if (a== 0)
{a2 = f/ m; fr << " "<< a2<< " "<< f << " "<< m<< endl; }
}
fr.close();
fd.close();
return 0;
}
Naujausi demotyvatoriai
Daugiau
#include <fcntl.h>
#include <io.h>
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
int main ()
{
ifstream fd("duomenys1.txt"); ofstream fr("resultatai1.txt");
int a, a2, f2, f, m, m2, i, n;
fr << "bandymu rezultatai:"<<endl;
fr << "--------------------------"<<endl;
fr << " a" << " f" << " m" << endl;
fr << "--------------------------" << endl;
fd >> n;
for (i = 1; i<=n; i= i+1){
fd >> a;
fd >> f;
fd >> m;
if (m== 0)
{m2 = f / a;fr << " "<< a<< " "<< f << " "<< m2<< endl; }
else if (f== 0)
{f2 = m * a; fr << " "<< a<< " "<< f2 << " "<< m<< endl; }
else if (a== 0)
{a2 = f/ m; fr << " "<< a2<< " "<< f << " "<< m<< endl; }
}
fr.close();
fd.close();
return 0;
}