dimanche 17 octobre 2010

pyramid.cpp/les mots.cpp

#include<string.h>
main()
{
      char *t,m[20];
      int n,i;
      printf("entrez la chine de carectaire");
     scanf("%s",&t);
     n=strlen(t);
     printf("%d",n);
     for(i=1;i<=4;i++)
     
    { 
                   
   
      { printf("%s",m); }}
     
    
    printf("%s",t);
     
                    
                      getch();
                      }

                                 download: pyramid.exe
#include<conio.h>
#include<stdio.h>
main()
{
char p,i,k,j,n,h;
h=1;
  printf("entre n");
  scanf("%d",&n);
 p=n;
  for(i=1;i<=n;i++)
  {for(j=1;j<=p;j++)
  {printf(" ");}
  for(k=1;k<=h;k++)
  {printf("*");}
  p=p-1;
  h=h+2;
  printf("\n");
}
p=1;
for(i=1;i<=n;i++)
{
                 for(j=1;j<=h;j++)
                 {printf("*");}
                 printf("\n");
                 for(k=1;k<=p;k++)
                 {printf(" ");}
                 p=p+1;
                 h=h-2;}
                 printf("*");
getch();
}
download :les_mots.exe

Aucun commentaire:

Enregistrer un commentaire