Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Russian");
- int a,b;
- cout<<"Введите стороны квадрата: ";
- cout<<"Длина=";
- cin>>a;
- cout<<"Ширина=";
- cin>>b;
- for(int i=1;i<=a;i++){
- for(int j=1;j<=b;j++){
- if ((i==1)||(j==1)||(i==a)||(j==b))cout<<"#";
- else cout<<" ";
- }
- cout<<endl;
- }
- }
- #include <iostream>
- using namespace std;
- int main()
- {
- int a,b;
- cout<<"Введите стороны треугольника: ";
- cout<<"Длина=";
- cin>>a;
- cout<<"Ширина=";
- cin>>b;
- int r,l;
- for(int i=1;i<=a;i++){
- for(int j=1;j<=b;j++){
- r=b/2+i;
- l=b/2-i;
- if ((j>l)&&(j<r))cout<<"*";
- else cout<<" ";
- }
- cout<<endl;
- }
- }
Add Comment
Please, Sign In to add comment