题目大意:求公元前 4713 年 1 月 1 日 经过 r 天后的日期,公元 1582 年 10 月 4 日以前适用儒略历,公元 1582 年 10 月 15 日以后适用格里高利历 q 次询问,\(q\leq 10^5\) 这题就我目前所知有三种做法: ###做法一 大概就是先把儒略历和格里高利历的 ...
分类:
其他好文 时间:
2020-11-16 13:38:47
阅读次数:
8
代码如下: 1 /*练习题目为:输出九九乘法表*/ 2 3 #include<stdio.H> 4 #include<stdlib.H> 5 6 /**********************程序分割线【TOP】******************************/ 7 void nine_ ...
分类:
编程语言 时间:
2020-11-16 13:09:50
阅读次数:
7
#include<stdio.h> int main() { int a=5,b=7,c=100,d,e,f; d=a/b*c; e=a*c/b; f=c/b*a; printf("d=%d,e=%d,f=%d\n",d,e,f); return 0; } 计算结果不同是因为整数相除所得商仍然是整数 ...
分类:
其他好文 时间:
2020-11-13 12:27:14
阅读次数:
5
输入:一定要限定大小 string tmp;//声明 tmp.resize(10086);//限定大小 scanf("%s", &tmp[0]);//输入 输出:string中的成员函数c_str()返回一个字符串指针 string tmp;//声明 printf("%s", tmp.c_str() ...
分类:
其他好文 时间:
2020-11-08 18:01:26
阅读次数:
33
判断语句 printf的格式输出 可以使用%5d这样来补空格,还有就是%05d这样子可以补0,还有%-5d是从右边补0 int a = 1,b=12,c=123; printf("%5d\n",a); // 1 printf("%05d\n",a); // 00012 printf("%-5d\n" ...
分类:
编程语言 时间:
2020-11-08 17:27:35
阅读次数:
17
#include<stdio.h> int main(){ unsigned int a, b, c; while(scanf("%d %d %d",&a, &b, &c)) { if(a+b>c && a+c>b && b+c>a){ if(a==b && b==c && a==c) printf ...
分类:
其他好文 时间:
2020-11-07 17:17:00
阅读次数:
16
#include<iostream> #include<cstdio> #include<set> #define MAXSIZE 51 using namespace std; set<int> s[MAXSIZE];/*建立set数组,自动除去重复的并且升序排好,然后利用count函数即可,知识 ...
分类:
其他好文 时间:
2020-11-07 16:42:41
阅读次数:
18
第一种方法#include<stdio.h>#include<Windows.h>#pragmawarning(disable:4996)intQishui(intn){inttotal=0;total+=n;for(;n>=2;n=n/2+n%2){total+=n/2;}returntotal;}intmain(){intmoney=0;printf("
分类:
其他好文 时间:
2020-11-07 16:25:52
阅读次数:
17
// ex1.cpp #include <stdio.h> int main(){ int a=5, b=7, c=100, d, e, f; d = a/b*c; e = a*c/b; f = c/b*a; printf("d=%d, e=%d, f=%d\n",d,e,f); return 0; ...
分类:
其他好文 时间:
2020-11-06 02:51:26
阅读次数:
55
封装打印,区分颜色,显示文件名,函数名和行号 01_test_printf.c #include <stdio.h> #define ANSI_COLOR_RED "\x1b[31m" #define ANSI_COLOR_GREEN "\x1b[32m" #define ANSI_COLOR_YE ...
分类:
其他好文 时间:
2020-11-06 02:32:36
阅读次数:
17