Jump to content

[C++] Desing triungiular.


HZ Rhino
 Share

Recommended Posts

Genereaza un vector de forma:

1

232

34543

4567654

567898765

67890109876

Programul:

#include<iostream>
using namespace std;
int v[100];
void triunghi(){int n,p,j,i,k,c;
cin>>n;
p=1;cout<<1<<endl;
for(j=2;j<=n;j++){
c=j%10;
for(i<=1;i<=j;i++){
cout<<c;
if(c==9)c=0;else c++;}
if(c==0) c=9;
else c--;
for(k=1;k<=j-1;k++)
{if (c==0) c=9;else c--
cout<<c;}
cout<<endl;}
int main(){
triunghi();
return 0;}
EDIT:Design Triunghiular ( imi pare rau,m-am grabit)
Edited by portocala2000
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.