Читайте также:
|
|
#include <iostream>
using namespace std;
int main()
{ int i,f,k,imax=1,kmax=1;
for(i=1;i<10000;i++)
{k=0;
for(f=1;f<i;f++)
{ if(i%f==0)
{ k=k+f; }
if(kmax<k)
{ kmax=k;
imax=i; } }}
cout<<"Число с максимальной суммой делителей= "<<imax<<endl;
cout<<"Cумма делителей= "<<kmax<<endl;
system("pause");
return 0;}
30) Calculate:
#include <iostream>
using namespace std;
void main()
{ float a=0;
for(int i=1;i<=100;i++)
for(int j=1;j<=100;j++) a+=(j-i+1)/(float)(i+j); cout<<a; }
1) Given a positive integer n, the integers a1,..., an. Find the number and the sum of the members of the sequence that are divisible by 5 and not divisible by 7.
2) Given positive integers n, p, integers a1,..., an. Find product of elements of the sequence a1,..., an which are multiple of p.
3) Given a positive integer n, the real numbers a1,.., an. Find: min (a2, a4,....) + max (a1, a3, a5,...).
4) Given a positive integer n, the real numbers a1,.., an. Find: max (a2, a4,....) + min (a1, a3, a5,...).
5) Given a positive integer n, the real numbers a1,..., an. Determine the number of pairs of consecutive integer numbers in this sequence which have both positive sign.
6) Given a positive integer n, the real numbers a1,..., an. Determine the number of pairs of consecutive integer numbers in this sequence which have different signs.
7) Given a positive integer n. Throw out digits 0 and 5 from decimal representation of this number, leaving the previous order of the remaining digits. For example, out of the number 59015509 we should get 919.
8) Given integers a, n, x1,..., xn (n> 0). Determine number of elements in the sequence x1,..., xn which are equal to a. If such a member is not present, then the answer should be 0.
9) Given a positive integer n, the real numbers a1,..., an. Print "YES", if the number of positive elements in the sequence is greater than the number of negative elements, otherwise display "NO".
10) Given a positive integer n, the integers a1,..., an. Find the number and the sum of the members of the sequence that are divisible by 3 and not divisible by 5.
11) Given a positive integer n, the symbols s1,..., sn. Calculate how many of these characters equal to + symbol.
12) Given a positive integer n, the symbols s1,..., sn. Calculate how many of these characters equal to * symbol.
15) Given a positive integer n, the symbols s1,..., sn. Remove from the sequence all the substrings which are equal to abcd.
17) Given a positive integer n, the symbols s1,..., sn. Determine the number of entries in this sequence of strings: abc and aba.
18) Given real numbers a1,..., a10. Calculate: a1 + a22 + a33+…+a1010.
19) Find the first 100 prime numbers.
20) Calculate:
21) Calculate:
22) Given real numbers x, y1,..., y25. In this sequence find two members, the arithmetic mean of which is closest to x.
23) Given a real number n. Get a real square matrix, where i = 1, n, j = 1, n and
24) Given a real square matrix of order 12. Replace with zeros elements on the diagonal and above it.
25) Given a real square matrix of order mxn. Determine the numbers b1,.., bm, which are equal to the sum of the elements of the corresponding row.
26) Given a real square matrix of order mxn. Determine the numbers b1,.., bm, which are equal to the product of the elements of the corresponding row.
27) Given a real square matrix of order mxn. Determine the numbers b1,.., bm, which are equal to the minimum element of the corresponding row.
28) Calculate:
29) Find a natural number from 1 to 10,000 with the maximum sum of its divisors.
30) Calculate:
Дата добавления: 2015-11-16; просмотров: 51 | Нарушение авторских прав
<== предыдущая страница | | | следующая страница ==> |
Личности и власти | | | Искренне убеждена, что большая доля интереса россиян к Греции возлагается именно на знакомство с ранних лет с античной мифологией. |