Jump to content
BLODAS

problema c++ clasa a 9a info intensiv

Recommended Posts

Guest demisec

iti fac schema, te descurci cu implementarea.

while(f>>n)

pui nr in vector.

ordonare vector. (bubble sort)

for(i=1;i<=n(nr de vectori);i+=10)

{for(j=1;j<=10;j++)

g<<v;

g<<endl}

daca nu reusesti nici acum, filologie

Link to comment
Share on other sites

ce am facut pana aici e bun?

#include<stdio.h>

#include<iostream.h>

FILE*f,*g;

int n,i,j,a[1001],

int main()

{

f=fopen("tema.in","r");

while(!feof(f))

{

n++;

fscanf(f,"%d",a[n]);

}

fclose(f);

g=fopen("tema.out","w");

for(i=1;i<=n;i+=10)

{for(j=1;j<=10;j++)

g<<a;

g<<endl}

Link to comment
Share on other sites

#include <fstream>
#include <vector>

int main()
{
std::ifstream in("tema.in");
std::vector<int> nr;
while(1)
{
int t;
in>>t;
nr.push_back(t);
if(in.eof())
break;
}
in.close();

std::ofstream out("tema.out");
for(int i=0;i<nr.size();i+=10)
{
for(int j=i;j<i+10;j++)
{
if(j>nr.size()-1)
break;
out<<nr[j]<<" ";
}
out<<std::endl;
}
out.close();
}

Link to comment
Share on other sites

Guest demisec

se folosesc in majoritatea cazurilor. eu asa am invatat intr-a 9a, asa era la olimpiada, asa e in modelele de atestat/bac

Link to comment
Share on other sites

Guest Kovalski

deschizi topic, ceri ajutor, dupa care te pisi pe el ?

+ dublu post + triplu post + limbaj de circ pe chat.

+ postat la programare cand de fapt trebuia la ajutor.

ban 1 zi + topic closed + trash

Link to comment
Share on other sites

Ba, ce sloboz de scoala faceti ma acum ? Cu jumatea de porc si damigeana de vin. Intrii aici, te ajuta baietii si tot tu esti tare-n gura. Pisa-te-ai caramizi si placi de azbociment.

ban 1 zi + topic closed + trash

Ce o zi bre ? Ban permanent ! :)) de la nasul mare.

Edited by aelius
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...