- 博客(16)
- 收藏
- 关注
转载 C++打印杨辉三角形
#include <iostream>#include <iomanip>#include <Windows.h>using namespace std;#define N 256void print_pyramid(int a[N][N], int lines);int main(void) { int n ...
2019-09-19 21:02:00
575
转载 C++利用权重方法将二进制正数转换为十进制数
#include <iostream>#include <Windows.h>#include <string>using namespace std;int main(void) { string str; int p = 1; //记录当前二进制权重 int s = 0; co...
2019-09-01 23:49:00
328
转载 利用倒除法将一个十进制数的正整数转换为二进制
#include <iostream>#include <Windows.h>using namespace std;int main(void) { int n = 0; int ret[32]; int i = 0; cout << "请输入一个正整数:"; cin &g...
2019-08-30 23:46:00
1016
转载 C++打印水仙花数
#include <iostream>#include <Windows.h>using namespace std;int main(void) { int a, b, c; for (int i = 100; i <= 999; i++) { a = i % 10; // 用变量i除10取...
2019-08-30 20:31:00
509
转载 C++打印乘法表
#include <iostream>#include <Windows.h>#include <iomanip>using namespace std;int main(void) { int width; for (int i = 1; i <= 9; i++) { for (in...
2019-08-28 21:23:00
1115
转载 C++根据用户输入打印对应的金层塔层数
#include <iostream>#include <Windows.h>using namespace std;int main(void) { int row; cout << "请输入金字塔层数:"; cin >> row; for (int i = 1; i...
2019-08-28 20:47:00
238
转载 让用户输入一个年份和月份,然后判断这个月有多少天
#include <iostream>#include <Windows.h>using namespace std;int main(void) { int year; int month; int days = 0; bool flag; // 标记是否是闰年 cout <&l...
2019-08-18 11:50:00
2714
转载 C++进行字母大小写转换
#include <iostream>#include <Windows.h>#include <string>using namespace std;int main(void) { char x; cout << "请输入一个字符:"; cin >> x; ...
2019-08-17 22:19:00
1171
转载 解决VS2017中使用scanf函数报错的问题
我们在VS2017中如果使用C语言的scanf输入函数,编译的时候编译器会报error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See onlin...
2019-08-17 16:52:00
375
转载 C 语言字符串的比较
C 语言字符串的比较#include <stdio.h>#include <Windows.h>#include <string.h>int main(void) { char addr[32]; printf("请问你是哪里人:"); scanf("%s",addr); ...
2019-08-10 15:47:00
199
转载 C 统计用户输入的总行数和字符长度
C 统计用户输入的总行数和字符长度#include <stdio.h>#include <Windows.h>int main(void) { char line[2048]; int count = 0; int length = 0; printf("请输入任意多行:\n"); ...
2019-08-10 13:39:00
255
转载 C 循环统计输入的单词个数和字符长度
C 循环统计输入的单词个数和字符长度#include <stdio.h>#include <Windows.h>int main(void) { char word[128]; int count = 0; int length = 0; printf("请输入任意多个单词:\n"); ...
2019-08-10 13:16:00
463
转载 C++ 统计用户输入的总行数和字符长度
C++ 统计用户输入的总行数和字符长度#include <iostream>#include <Windows.h>#include <string>using namespace std;int main(void) { string line; int count = 0; int le...
2019-08-10 12:04:00
521
转载 C++浮点数据的输出控制
#include <iostream>#include <Windows.h>using namespace std;int main(void) { double value = 12.3456789; // cout默认输出6位有效数字 cout << value << endl...
2019-07-31 10:04:00
328
转载 django修改表数据结构后报错的解决办法
1、进入数据库删除app之前创建的表,如果删除有关联的表报错的话可以先删除其他表然后再删除因关联关系删除不了的表2、删除django_migrations表中对应的app记录,删除命令delete from django_migrations where app='xxx(app名称)';3、删除app对应migrations目录下的所有文件4、重新执行python mana...
2019-07-17 10:44:00
259
转载 python实现查找最长公共子序列
#!/usr/bin/python# -*- coding: UTF-8 -*-worlds = ['fosh','fort','vista','fish','hish','hello','ohddad','abofa']user_input = 'frt'def find_longest_substring(world_a,world_b): ...
2019-07-15 21:23:00
370
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅