![]() |
Помогите составить блок схемы алгоритма решения задачи которую уже написали в С
№1 задачГо
#include <iostream.h> #include <conio.h> main () { clrscr(); int mas [100],M[100],k=0,l=999,n,i,s=1; int sum=0; cout<<"write amount elements of masiv :"; cin>>n; cout<<"please,write this elements :\n"; for (i=1;i<=n;i++) cin >> mas[i];cout<<"YOUR masiv\n"; for (i=1;i<=n;i++) cout<<" "<<mas[i]; for (i=1;i<=n;i++) if (mas[i]<0) {sum+=mas[i];} cout<<"\n"<<"sum of the negative elements = "<<sum; k=mas[1]; int f=1; for (i=1;i<=n;i++) if (mas[i]>k) {k=mas[i]; f=i;} int g=1; for (i=1;i<=n;i++) if (mas[i]<l) {l=mas[i]; g=i;} if (g>f) {for (i=f;i<=g;i++) s*=mas[i]; cout<<"\n Multiplication of the elements between max and min = "<<s; } if (f>g) {for (i=g;i<=f;i++) s*=mas[i]; cout<<"\n Multiplication of the elements between min and max = "<<s; } getch(); return 0; } :молись: №2 задачГо :confused: #include <iostream.h> #include <conio.h> void main() {clrscr(); int i,j,s,q; do { cout<<"write first - "; cin>>i; cout<<"write second - "; cin>>j; s=i+j; cout<<"result = "<<s<<"\n"; cout<<"Are you whant to restart this operation?\n"; cout<<"If you WANT, push- 1, if NO, push what you want\n"; cin>>q; } while (q==1) ; cout<<"Good-bye)))"; getch(); } :молись: |
Ну и что у тебя не получается?
Обычную команду в прямоугольник, if в ромбик. |
Цитата:
|
Вложений: 1
Вот тебе для второй задачки пример... Первую сам по этому примеру сделаешь.
|
Часовой пояс GMT +4, время: 07:56. |
Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.