0% found this document useful (0 votes)
24 views5 pages

#Include #Include Using Namespace Int Int

The document contains code for several C++ programs that perform various calculations and output results. The programs include: 1. A program that takes a number as input, determines the number of digits, sums the digits, and outputs the first and last digits. 2. A program that takes a number as input, separates it into digits, checks for palindrome or repeating digits patterns, and outputs the results. 3. A program that takes an angle in degrees as input, converts it to hours and minutes, and outputs the results. 4. A program that takes hours and minutes as input, calculates the angle between the hour and minute hands after a number of minutes, and outputs the time at which they

Uploaded by

shownshark
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views5 pages

#Include #Include Using Namespace Int Int

The document contains code for several C++ programs that perform various calculations and output results. The programs include: 1. A program that takes a number as input, determines the number of digits, sums the digits, and outputs the first and last digits. 2. A program that takes a number as input, separates it into digits, checks for palindrome or repeating digits patterns, and outputs the results. 3. A program that takes an angle in degrees as input, converts it to hours and minutes, and outputs the results. 4. A program that takes hours and minutes as input, calculates the angle between the hour and minute hands after a number of minutes, and outputs the time at which they

Uploaded by

shownshark
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

67.

#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>

using namespace std;


int main() {
int n, a, b, c, d;
cout<<"n:";
cin>>n;
if(n
d =
c =
b =
a =

<= 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;

cout<<"ugol dlya minutnoi strelki raven:"<<minutUgl<<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;

//chasov > 0 && chasov <= 12;


//minut >= 0 && minut < 60;
// problema v tom chto programm chitaet otklonenie strelki s tochnostiu
v 0.5 gradusov
//i moment kogda strelka peresekaet druguiu ne ulavlivaetsya

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) {
}

minutUgl = minutUgl - 720;

if(chasovUgl == minutUgl){
}

cout<<"sovpadaiutsya cherez "<<minut1<<" minute"<<endl;

}
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;
}

You might also like