题目:输入一个整数,并将其反转后输出。 程序分析:无。 实例 - 使用 strlen() 1 #include <stdio.h> 2 int main() 3 { 4 int n, reversedNumber = 0, remainder; 5 6 printf("输入一个整数: "); 7 s ...
分类:
其他好文 时间:
2020-07-14 13:51:43
阅读次数:
51
动作 printf printf 可以实现格式化输出格式: printf “FORMAT”, item1, item2, ... 说明: 必须指定FORMAT 不会自动换行,需要显式给出换行控制符 \n FORMAT中需要分别为后面每个item指定格式符 格式符:与item一一对应 %c:显示字符的 ...
分类:
其他好文 时间:
2020-07-14 09:20:53
阅读次数:
73
1、 #include<stdio.h>#include<stdlib.h>#include<getch.h> int main(int argc,const char* argv[]){ char map[8][8] = { {0,0,3,3,3,3,0,0}, {0,0,3,5,5,3,0,0} ...
分类:
其他好文 时间:
2020-07-14 00:25:43
阅读次数:
65
1 C语言代码 1 #include <stdio.h> 2 #include <unistd.h> 3 4 int main() 5 { 6 if(!fork()){while(1)printf(“A”);} 7 if(!fork()){while(1)printf(“B”);} 8 wait() ...
分类:
其他好文 时间:
2020-07-12 22:36:25
阅读次数:
81
//方法:函数指定接收者之后就是方法,只有某个具体的类型才能调用 package main import "fmt" type people struct { name string gender string } //go中,约定使用类型首字母小写 func (p people) dream() ...
分类:
其他好文 时间:
2020-07-12 22:10:36
阅读次数:
69
第1章 例:检查文件系统挂载状态 1.1 自动发现文件系统名称脚本 vi Linux_mountfilename_discovery.sh portarray=(`mount |grep "^/" |grep -E "ext3|reiserfs|ext4|xfs" |awk '{print $3}' ...
分类:
其他好文 时间:
2020-07-12 17:16:39
阅读次数:
174
#include<iostream> #include<cstdio> using namespace std; int main() { int a,b; cin>>a>>b; int c; c=(b-a); if(c%100>=50) c+1; //这里错误,应先换算成正常单位在进行+1的四舍五 ...
分类:
其他好文 时间:
2020-07-12 14:32:01
阅读次数:
56
题目描述迷途竹林的兔子们玩起了一个游戏。首先,兔子们绕成一个环。每只兔子随机捡起红色或者蓝色的木棒。紧接着,拿着相同颜色木棒的兔子可以把他们的木棒连接起来。显然,每只兔子只能连接到另一只兔子。同时,木棒相交是不被允许的。这样,总有一些兔子无法和其他兔子连接起来。绕着手下的兔子们转了几圈之后,因幡帝突... ...
分类:
其他好文 时间:
2020-07-12 14:09:51
阅读次数:
66
题目 174. 地下城游戏 我的思路 根据题目中的条件,M*N的网格以及移动路线只能向右或者向下,很容易想到用动态规划迭代的方法,去依次计算每个网格的情况。 我一开始的想法是从左上角推往右下角,可是在推导中遇到了困难: 首先是发现可能需要两个辅助数组来存储相关数据,一个是最小初始健康点数,另一个是当 ...
分类:
其他好文 时间:
2020-07-12 14:05:22
阅读次数:
45
如何在输入输出上提高一下效率emmmm 1 #include<iostream> 2 #include<stdio.h> 3 #include<stdlib.h> 4 #include<time.h> 5 using namespace std; 6 7 int main(){ 8 int star ...
分类:
移动开发 时间:
2020-07-12 12:12:53
阅读次数:
67