Вопрос школьника по предмету Информатика
Задано два цілих числа А і В (А числа, розташовані між AiB (не включаючи числа А і В), а також кількість N цих чисел.
Програмування python. СРОЧНО!!!
Ответ учителя по предмету Информатика
Ответ:
#include <bits/stdc++.h>
using namespace std;
long long a,b,c,A,B,count1=0;
long long min1;
int main()
{
cin>>A>>B;
for(int i=B-1;i>A;i—){
cout<<i<<» «;
count1++;
}
cout<<endl;
cout<<count1<<endl;
return 0;
}
Объяснение:
Програма написана на c++, я думаю ти напишеше на пайтоні тому, що у моєму варінті показано як це усе має працювати.
1.Спочатку ти вводиш 2 цілих числа. //cin>>A>>B;
2.Робиш цикл від B до A
3. Виводиш i(це може бути люда змінна)
4.Лічильник++
5.cout<<endl; я просто роблю пропуск, для удобства.
6.Вивожу лічильник на екран
Похожие вопросы от пользователей
Complete the sentences with the words from the word box in the correct form.
have to know laws well
have to answer the telephone
have to wear trainers
have to get up early
have to work
have to use a computer
have to carry heavy things very often
must like babies company and be responsible
must pay attention to small detail
0. Mrs Gordon is a postal worker, she HAS TO WEAR TRAINERS.
1. If Jennifer wants to go baby-sitting she _____.
2. Joel wants to become a computer operator. Does he _____ well?
3. Nanny _____ of a boy.
4. Mrs Lee had a part-time job. Did she _____ at the weekend?
5. Cleaning is hard work. You _____.
6. Laura is a secretary, so she often _____.
7. Mrs and Mr White atre going to work tomorrow morning, so they _____.
8. Mr Bixby is a lawyer, so he _____.