1.
#include
using namespace std;
int main()
{
int a, b;
cout << "a = ", cin >> a;
cout << "b = ", cin >> b;
for (int i=a; i<=b; i++) {<br> cout << i << " ";<br> }
return 0;
}
Пример:
a = 5
b = 12
5 6 7 8 9 10 11 12
2.
#include
using namespace std;
int main()
{
int a, b, s=0;
long long p=1;
cout << "a = ", cin >> a;
cout << "b = ", cin >> b;
for (int i=a; i<=b; i++) {<br> p = p*i;
s = s+i;
}
cout << "p = " << p << " s = " << s;<br> return 0;
}
Пример:
a = 5
b = 12
p = 19958400 s = 68