C++ 把二进制数转换为十进制数
摘要:#include <iostream> #include <windows.h> #include <string> using namespace std; int main() { string str; int p = 1; int s = 0; cout << "请输入一个二进制数:"; c
阅读全文
posted @
2022-08-11 12:00
wshidaboss
阅读(1139)
推荐(0) 编辑
C++用短除法把十进制转换为二进制输出
摘要:#include <iostream> #include <Windows.h> #include <string> using namespace std; int main() { int n; int ret[32]; int i = 0; cout << "请输入一个正整数:"; cin >
阅读全文
posted @
2022-08-08 20:50
wshidaboss
阅读(183)
推荐(0) 编辑
输入行数,用C++打印倒三角星号
摘要:#include <iostream> #include <Windows.h> #include <string> using namespace std; int main() { int row; cout << "请输入倒三角的行数:"; cin >> row; for (int i = 1
阅读全文
posted @
2022-08-08 19:26
wshidaboss
阅读(720)
推荐(0) 编辑
输入行数,用C++打印金字塔型星号
摘要:#include <iostream> #include <windows.h> #include <string> using namespace std; int main() { int row; cout << "请输入行数:"; cin >> row; for (int i = 1; i
阅读全文
posted @
2022-08-08 19:17
wshidaboss
阅读(519)
推荐(0) 编辑
用C++打印乘法口诀表(VS2019)
摘要:#include <iostream> #include <windows.h> #include <string>#include <iomanip> using namespace std; int main() { int width; for (int i = 1; i < 10; i++)
阅读全文
posted @
2022-08-08 19:11
wshidaboss
阅读(136)
推荐(0) 编辑
用C++输出所有的水仙花数
摘要:#include <iostream> #include <windows.h> #include <string> using namespace std; int main(void) { int a, b, c; for (int i = 100; i <= 999; i++) { a = i
阅读全文
posted @
2022-08-08 19:00
wshidaboss
阅读(109)
推荐(0) 编辑
用C++输出指定项的斐波那契数列
摘要:#include <iostream> #include <string> #include <windows.h> using namespace std; int main() { int n; long long s; long long a = 1; long long b = 1; whi
阅读全文
posted @
2022-08-08 18:52
wshidaboss
阅读(89)
推荐(0) 编辑