Skip to content

Commit

Permalink
Integer has been solved
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobur Yusupov committed Jan 4, 2024
1 parent 028e470 commit 784c29f
Show file tree
Hide file tree
Showing 30 changed files with 458 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Integer/Integer1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <iostream>

int main() {
int L;

std::cin >> L;

int meter = L / 100;
std::cout << meter << std::endl;

return 0;
}
17 changes: 17 additions & 0 deletions Integer/Integer10.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <iostream>

int main() {
int number;

std::cout << "Enter a three-digit number: ";
std::cin >> number;

const int HundredsPlace = number / 100;
const int TensPlace = (number % 100) / 10;
const int OnesPlace = number % 10;

std::cout << "Ones place: " << OnesPlace << std::endl;
std::cout << "Tens place: " << TensPlace << std::endl;

return 0;
}
17 changes: 17 additions & 0 deletions Integer/Integer11.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <iostream>

int main() {
int number;

std::cout << "Enter a three-digit number: ";
std::cin >> number;

const int HundredsPlace = number / 100;
const int TensPlace = (number % 100) / 10;
const int OnesPlace = number % 10;

std::cout << "Sum: " << OnesPlace + TensPlace + HundredsPlace << std::endl;
std::cout << "Product: " << OnesPlace * TensPlace * HundredsPlace << std::endl;

return 0;
}
16 changes: 16 additions & 0 deletions Integer/Integer12.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <iostream>

int main() {
int number;

std::cout << "Enter a three-digit number: ";
std::cin >> number;

const int HundredsPlace = number / 100;
const int TensPlace = (number % 100) / 10;
const int OnesPlace = number % 10;

std::cout << OnesPlace * 100 + TensPlace * 10 + HundredsPlace << std::endl;

return 0;
}
16 changes: 16 additions & 0 deletions Integer/Integer13.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <iostream>

int main() {
int number;

std::cout << "Enter a three-digit number: ";
std::cin >> number;

const int HundredsPlace = number / 100;
const int TensPlace = (number % 100) / 10;
const int OnesPlace = number % 10;

std::cout << OnesPlace * 10 + TensPlace * 100 + HundredsPlace << std::endl;

return 0;
}
16 changes: 16 additions & 0 deletions Integer/Integer14.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <iostream>

int main() {
int number;

std::cout << "Enter a three-digit number: ";
std::cin >> number;

const int HundredsPlace = number / 100;
const int TensPlace = (number % 100) / 10;
const int OnesPlace = number % 10;

std::cout << OnesPlace * 100 + TensPlace + HundredsPlace * 10 << std::endl;

return 0;
}
16 changes: 16 additions & 0 deletions Integer/Integer15.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <iostream>

int main() {
int number;

std::cout << "Enter a three-digit number: ";
std::cin >> number;

const int HundredsPlace = number / 100;
const int TensPlace = (number % 100) / 10;
const int OnesPlace = number % 10;

std::cout << OnesPlace + TensPlace * 100 + HundredsPlace * 10 << std::endl;

return 0;
}
16 changes: 16 additions & 0 deletions Integer/Integer16.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <iostream>

int main() {
int number;

std::cout << "Enter a three-digit number: ";
std::cin >> number;

const int HundredsPlace = number / 100;
const int TensPlace = (number % 100) / 10;
const int OnesPlace = number % 10;

std::cout << OnesPlace * 10 + TensPlace + HundredsPlace * 100 << std::endl;

return 0;
}
17 changes: 17 additions & 0 deletions Integer/Integer17.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <iostream>

int main() {
int number;

// Input an integer greater than 999
std::cout << "Enter an integer greater than 999: ";
std::cin >> number;

// Extract the hundreds digit using integer division and remainder
int hundredsDigit = (number / 100) % 10;

// Output the result
std::cout << "Hundreds digit: " << hundredsDigit << std::endl;

return 0;
}
17 changes: 17 additions & 0 deletions Integer/Integer18.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <iostream>

int main() {
int number;

// Input an integer greater than 999
std::cout << "Enter an integer greater than 999: ";
std::cin >> number;

// Extract the hundreds digit using integer division and remainder
int hundredsDigit = (number / 1000) % 100;

// Output the result
std::cout << "Hundreds digit: " << hundredsDigit << std::endl;

return 0;
}
11 changes: 11 additions & 0 deletions Integer/Integer19.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <iostream>

int main() {
int seconds;
std::cin >> seconds;

int minutes = seconds / 60;
std::cout << minutes << std::endl;

return 0;
}
12 changes: 12 additions & 0 deletions Integer/Integer2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <iostream>

int main() {
int M;

std::cin >> M;

int ton = M / 1000;
std::cout << ton << std::endl;

return 0;
}
11 changes: 11 additions & 0 deletions Integer/Integer20.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <iostream>

int main() {
int seconds;
std::cin >> seconds;

int minutes = seconds / 3600;
std::cout << minutes << std::endl;

return 0;
}
11 changes: 11 additions & 0 deletions Integer/Integer21.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <iostream>

int main() {
int seconds;
std::cin >> seconds;

int passedSeconds = seconds % 60;
std::cout << passedSeconds << std::endl;

return 0;
}
10 changes: 10 additions & 0 deletions Integer/Integer22.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <iostream>

int main() {
int seconds;
std::cin >> seconds;

std::cout << seconds % 3600 << std::endl;

return 0;
}
10 changes: 10 additions & 0 deletions Integer/Integer23.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <iostream>

int main() {
int seconds;
std::cin >> seconds;

std::cout << (seconds % 3600) / 60 << std::endl;

return 0;
}
23 changes: 23 additions & 0 deletions Integer/Integer24.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <iostream>
#include <map>

int main() {
std::map<int, std::string> Days;

Days[0] = "Sunday";
Days[1] = "Monday";
Days[2] = "Tuesday";
Days[3] = "Wednesday";
Days[4] = "Thursday";
Days[5] = "Friday";
Days[6] = "Saturday";

int K;
std::cin >> K;

int dayIndex = K % 7;

std::cout << Days[dayIndex] << std::endl;

return 0;
}
23 changes: 23 additions & 0 deletions Integer/Integer25.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <iostream>
#include <map>

int main() {
std::map<int, std::string> Days;

Days[0] = "Sunday";
Days[1] = "Monday";
Days[2] = "Tuesday";
Days[3] = "Wednesday";
Days[4] = "Thursday";
Days[5] = "Friday";
Days[6] = "Saturday";

int K;
std::cin >> K;

int dayIndex = (K + 3) % 7;

std::cout << Days[dayIndex] << std::endl;

return 0;
}
23 changes: 23 additions & 0 deletions Integer/Integer26.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <iostream>
#include <map>

int main() {
std::map<int, std::string> Days;

Days[0] = "Sunday";
Days[1] = "Monday";
Days[2] = "Tuesday";
Days[3] = "Wednesday";
Days[4] = "Thursday";
Days[5] = "Friday";
Days[6] = "Saturday";

int K;
std::cin >> K;

int dayIndex = (K + 1) % 7;

std::cout << Days[dayIndex] << std::endl;

return 0;
}
23 changes: 23 additions & 0 deletions Integer/Integer27.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <iostream>
#include <map>

int main() {
std::map<int, std::string> Days;

Days[0] = "Sunday";
Days[1] = "Monday";
Days[2] = "Tuesday";
Days[3] = "Wednesday";
Days[4] = "Thursday";
Days[5] = "Friday";
Days[6] = "Saturday";

int K;
std::cin >> K;

int dayIndex = (K + 5) % 7;

std::cout << Days[dayIndex] << std::endl;

return 0;
}
23 changes: 23 additions & 0 deletions Integer/Integer28.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <iostream>
#include <map>

int main() {
std::map<int, std::string> Days;

Days[0] = "Sunday";
Days[1] = "Monday";
Days[2] = "Tuesday";
Days[3] = "Wednesday";
Days[4] = "Thursday";
Days[5] = "Friday";
Days[6] = "Saturday";

int K, N;
std::cin >> K >> N;

int dayIndex = (K + N - 2) % 7 + 1;

std::cout << Days[dayIndex] << std::endl;

return 0;
}
14 changes: 14 additions & 0 deletions Integer/Integer29.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <iostream>

int main() {
int A, B, C;

std::cin >> A >> B >> C;

int a_c = int(A / C);
int b_c = int(B / C);

std::cout << a_c * b_c;

return 0;
}
Loading

0 comments on commit 784c29f

Please sign in to comment.