码迷,mamicode.com
首页 >  
搜索关键字:for while    ( 28479个结果
python 绘制五角星
import turtledef main(): count = 1 while count <= 5: turtle.forward(100) turtle.right(144) count = count + 1 turtle.exitonclick()if __name__== '_main_ ...
分类:编程语言   时间:2020-08-05 23:27:07    阅读次数:104
蛇形矩形(HJ35)
一:解题思路 二:完整代码示例 (C++版和Java版) C++代码: #include <iostream> using namespace std; int main() { int k = 0; int N = 0; int num = 0; while (cin >> k) { num = ...
分类:其他好文   时间:2020-08-05 22:14:18    阅读次数:96
统计每个月兔子的总数(HJ37)
一:解题思路 这道题目的本质就是求斐波那契数列的第n项。 二:完整代码示例 (C++版和Java版) C++代码: #include <iostream> using namespace std; int main() { int months = 0; while (cin >> months) ...
分类:其他好文   时间:2020-08-05 19:41:00    阅读次数:68
shell脚本和任务基础
1、显示统计占用系统内存最多的进程,并排序。 有多种方法(我写了其中2种):1.top命令的内置命令M。 2.ps aux --sort=-%mem 2、编写脚本,使用for和while分别实现192.168.0.0/24网段内,地址是否能够ping通,若ping通则输出"success!",若pi ...
分类:系统相关   时间:2020-08-05 10:40:20    阅读次数:105
C语音while循环语句的用法
一个简单的计时器。1t为单位的那种
分类:其他好文   时间:2020-08-04 10:12:06    阅读次数:90
【O365 PowerShell Script】隔离邮件报告
#O365的隔离报告https://protection.office.com/quarantine可以在365的网址上拿到,但是却无法导出,以下脚本可以将隔离的邮件导出,并使用while循环解决单条命令的1000个数据的限制#O365‘squarantinereporthttps://protection.office.com/quarantinecanbeobtainedonthe36
分类:系统相关   时间:2020-08-03 18:41:58    阅读次数:82
c#简单的文件操作
FileInfo 使用FileInfo类的对象进行文件进行外部操作: FileInfo file = new FileInfo(@".\..\..\lzx.txt"); if (file.Exists) { Console.WriteLine("lzx.txt存在"); //file.Delete( ...
分类:Windows程序   时间:2020-08-03 18:37:59    阅读次数:98
DNA序列 (HJ63)
一:解题思路 二:完整代码示例 (C++版和Java版) C++代码: #include <iostream> #include <string> using namespace std; int main() { string s = ""; int n = 0; while (cin >> s ...
分类:其他好文   时间:2020-08-03 13:30:56    阅读次数:76
位运算统计二进制整数中1的个数
k=k&(k-1)可以消除k的二进制数的最后一个1.连续进行这个操作,每次消除一个1,直到全部消除为止。操作次数就是1的个数。 int num=0; cin>>k; while(k>0) { k=k&(k-1); num++; } cout<<num<<endl; ...
分类:其他好文   时间:2020-08-03 09:50:59    阅读次数:87
Lock Her Up
题意描述 同样没有链接...。 Problem 2: Lock Her Up [Jan Kuipers, 2003] Bessie has been bad again and Farmer John must punish her by locking her up for a while. On ...
分类:其他好文   时间:2020-08-02 23:35:51    阅读次数:104
28479条   上一页 1 ... 70 71 72 73 74 ... 2848 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!