Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Halp plz, C++

Name: Anonymous 2007-11-28 10:39

Hi /prog/, I have a problem...

I'm a noob at C++ (I learned it at school, so, yeah...) and I've got to make a program, which I find pretty difficult. i'm coming here seeking your help because I NEED a good grade if I want to validate my semester, and programming is highly coefficiented, so if you don't help me, i'm pretty much fucked...

So here's the deal:

Make a program which allows the input of a serie of integers and stocks them in a table, then display the table as it is and then display the table with the numbers sorted out in growing order...

I am a total noob at C (as I already mentioned) and I have no fucking clue about how to do this kind of shit.

So your help would be really, really, REALLY appreciated...
Pretty please?

Name: Anonymous 2007-11-29 12:55

hi everyone, it's me again!

About the code posted yesterday, i know it's shit, but I didn't care at the time because, well, strangely enough it worked, so I was content with it.

This morning, during the lesson, we worked on it (because noone had been able to find it), and we finally figured out how to do it.

So here it is, enjoy:

#include <stdio.h>
#include <math.h>
#include <conio.h>

main()
{
      int i,j,taille,b;
     
      printf("entrez la taille du tableau");
      scanf("%d",&taille);
      int tab[taille];
      printf("entrez %d valeurs",taille);
      for(i=1,i<=taille,i++)
      {
            scanf("%d",&tab[i]);
      }
      for(i=1,i<=taille,i++)
      {
            printf("%d",tab[i]);
      }
      for(i=1,i<=taille,i++)
      {
            for(j=1,j<=taille,j++)
            {
                    if(tab[i]<tab[j])
                    {
                          b=tab[i];
                          tab[i]=tab[j];
                          tab[j]=b;
                    }
            }
      }
      for(i=1,i<=taille,i++)
      {
            printf("%d",tab[i]);
      }
}

Well?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List