#Include #Include Using Namespace Int Int
#Include #Include Using Namespace Int Int
#include<iostream>
#include<cmath>
using namespace std;
int main() {
int n, x, y, z, cifr, sum;
cout<<"n:";
cin>>n;
if (n == 100) {
x = 1;
cout<<"cifr:3\n";
}
if(n > 9 && n < 100) {
cout<<"cifr:2\n";
}
if (n > 0 && n < 10) {
cout<<"cifr:1\n";
}
y = (n - (n % 10))/10;
z = n % 10;
x = n - 10*y - z;
if (y == 10) {
x = x + 1;
y = 0;
}
sum = x + y + z;
cout<<"summa cifr:"<<sum<<endl;
if(n == 100){
cout<<"pervaiya cifra:"<<x<<endl;
cout<<"poslednyaiya cifra:"<<z<<endl;
}
else if (n > 9 && n < 100) {
cout<<"pervaiya cifra:"<<y<<endl;
cout<<"poslednyaiya cifra:"<<y<<endl;
}else if (n < 10) {
cout<<"pervaiya cifra:"<<z<<endl;
}
return 0;
68.
#include<iostream>
#include<cmath>
<= 9999) {
n % 10;
(n % 100 - d) / 10;
(n%1000 - 10 * c - d) / 100;
(n - b * 100 - c * 10 -d) / 1000;
if(a == d && c == b) {
cout<<"Polindrom!"<<endl;
}
if((a == b && b == c)||(b == c && c == d)||(a == b && b == d)||(a
== c && c == d)){
cout<<"chislo soderzhit tri odinakovyh chisla!"<<endl;
}
if(a != b && a != c && a != d && b != c && b != d && c != d){
cout<<"Vse chetyre cifry razlichny!"<<endl;
}
}
return 0;
}
69.
#include<iostream>
#include<cmath>
using namespace std;
int main() {
int n, minutUgl, chasov;
double minuty,x;
cout<<"n:";
cin>>n;
//znachenie ugla vvodit' ot 0 do 360.
n > 0 && n <= 360;
if (n % 30 == 0) {
cout<<"chasov:"<<n / 30<<endl;
cout<<"ugol dlya minutnoi strelik ravenn:0"<<endl;
}
else {
x = n % 30;
minuty = x * 2;
minutUgl = minuty * 6;
cout<<"chasov:"<<n / 30<<endl;
cout<<"minuty:"<<minuty<<endl;
return 0;
70.
#include<iostream>
#include<cmath>
using namespace std;
int main() {
double minutUgl,minut, chasov, chasovUgl,cikle, i, minut1;
cout<<"chasov:";
cin>>chasov;
cout<<"minut:";
cin>>minut;
minut1 = 0;
minutUgl = minut * 6;
chasovUgl = chasov * 30;
for(i = 0; i < 720; i ++) {
minut1 += 1;
minutUgl = minutUgl + 6;
chasovUgl = chasovUgl + 0.5;
if(minutUgl > 360) {
minutUgl = minutUgl - 360;
}
if(minutUgl > 720) {
}
if(chasovUgl == minutUgl){
}
}
return 0;
}
77g.
#include<iostream>
#include<cmath>
using namespace std;
int main() {
double n,k,l,i,m,j;
cout<<"Vvedite n:";
cin>>n;
//znachenie n vvodit v gradusah:
k = 0;
m = 1;
j = 0;
for(i = 0; i < n; i++){
l = sin(i);
m = m + l;
k = (1 / m);
j = j + k;
}
cout<<"ravno(vyhisleniya gradusami):"<<j<<endl;
return 0;
}
Binarnyi.
#include<iostream>
#include<cmath>
using namespace std;
int main() {
int a,b,c,x1,x2,xn,i,res;
cout<<"vvedite chislo a"<<endl;
cin>>a;
cout<<"Binary representation is: ";
i = 1;
x1 = 0;
x2 = 0;
res = 0;
while(a != 0){
xn = a % 2;
i = i * 10;
if(xn == 1){
x1 = x1 + 1;
a = (a - 1)/2;
res = res + 1 * i /10;
}
if(xn == 0) {
x2 = x2 + 1;
a = a / 2;
res = res + 0 *i/10;
}