Skip to content

Instantly share code, notes, and snippets.

View wingofthestar's full-sized avatar

wingofthestar

View GitHub Profile
#include<stdio.h>
int main() {
freopen("D://WorkSpace//input.txt", "r", stdin);
freopen("D://WorkSpace//output.txt", "w", stdout);
int x;
int count = 0;
while (scanf("%d", &x) != -1) {
do
{
x = x / 10;
@wingofthestar
wingofthestar / 确定int型整数的最小值和最大值
Last active July 4, 2017 03:24
写一个程序,确定int型整数的最小值和最大值为多少
#include<stdio.h>
void main() {
int i = 1;
while (i > 0) {
i++;
}
printf("Min = %d, Max = %d\n", i , i-1);
system("pause");
}
@wingofthestar
wingofthestar / 鸡兔同笼
Last active July 4, 2017 03:24
鸡兔同笼问题
#include<stdio.h>
int main() {
int a, b, n, m;
scanf("%d%d", &n, &m);
a = (4 * n - m) / 2;
b = n - a;
if (m % 2 == 1 || a < 0 || b < 0) {
printf("No answer\n");
}
else {
@wingofthestar
wingofthestar / 三位数反转(2)
Last active July 4, 2017 03:25
三位数反转(2)
#include<stdio.h>
int main() {
int n;
int m;
scanf("%d", &n);
m = (n % 10) * 100 + (n / 10 % 10) * 10 + (n / 100);
printf("%d", m);
system("pause");
return 0;
}
@wingofthestar
wingofthestar / 三位数反转(1)
Last active July 4, 2017 03:25
三位数反转(1)
#include<stdio.h>
int main() {
int n;
scanf("%d", &n);
printf("%d%d%d\n", n%10, n/10%10, n/100);
system("pause");
return 0;
}
@wingofthestar
wingofthestar / .md
Last active September 10, 2018 10:24
Gist的使用介绍

Gist的使用

  • Gist可以用来记录自己编写的代码片段,或自己想要记录的代码片段

  • 代码片段可以链接到自己的博客网页等实现共享

  • 也可以在Github的Gist中搜索关键字寻找代码片段