码迷,mamicode.com
首页 >  
搜索关键字:Shell while    ( 55956个结果
int func(int n){ int i = 0,sum = 0; while(s < n) s += ++i; return i; }
int func(int n){ int i = 0,sum = 0; while(sum < n) sum += ++i; return i; } 求时间复杂度 A. O(logn) B. O(n^1/2) C. O(n) D. O(nlogn) ++i, i = 1,2,3,4,5,···,k。 ...
分类:其他好文   时间:2021-04-10 13:08:02    阅读次数:0
Shell 08 awk高级用法
1. 指定宽度对齐 说明: %-30s表示输出字符串,宽度30位,左对齐. %-15s用来指定第二列的,左对齐,宽度15. 两个百分号之间可以没有空格. 使用\n对每一行的输出加上换行符。 work]# awk -F: '{print "user:" $1"\t\tuid:" $3}' /etc/p ...
分类:系统相关   时间:2021-04-10 13:03:55    阅读次数:0
俄罗斯方块-shell脚本写的,学习学习
#!/bin/bash APP_NAME="${0##*[\\/]}" APP_VERSION="1.0" #颜色定义 iSumColor=7 #颜色总数 cRed=1 #红色 cGreen=2 #绿色 cYellow=3 #××× cBlue=4 #蓝色 cFuchsia=5 #紫红色 cCyan ...
分类:系统相关   时间:2021-04-09 13:30:17    阅读次数:0
Java实现一个简易计算器
做一个多功能计算器 欢迎使用计算器系统 int + int double + double 、 计算 n 的阶乘 计算 a的 n次方、 退出系统 import java.util.Scanner; public class Calculator { public static void main(S ...
分类:编程语言   时间:2021-04-09 12:50:24    阅读次数:0
快速幂取模
long long myPow(long long x, int n) { long long ans = 1; while(n){ if(n % 2 != 0){ ans *= x; ans %= modN; } x *= x; x %= modN; n /= 2; } return ans; } ...
分类:其他好文   时间:2021-04-08 13:55:01    阅读次数:0
pat甲级 1031 Hello World for U
题目: Given any string of N (≥) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as: h d e l ...
分类:其他好文   时间:2021-04-08 13:31:19    阅读次数:0
Shell sed
sed编辑器:流编辑器(stream editor)。 vim:文本编辑器。 流编辑器会在编辑器处理数据之前基于预先提供的一组规则来编辑数据流。 sed编辑器的处理流程 读入一行数据 根据给出的编辑器命令匹配数据 按照命令修改流中的数据 将新的数据输出到STDOUT sed命令格式 sed opti ...
分类:系统相关   时间:2021-04-08 13:24:35    阅读次数:0
题目:9. 回文数
方式一(将整数转换为字符串,在转换为字符数组): public boolean isPalindrome(int x) { if (x < 0) { return false; } char[] chars = new String(Integer.toString(x)).toCharArray( ...
分类:其他好文   时间:2021-04-08 13:10:24    阅读次数:0
二叉树——102. 二叉树的层序遍历
二叉树——102. 二叉树的层序遍历 题目: 思路: 就是层序遍历,一层层扫下去,然后通过队列去实现,一个队列先暂存这一层的所有结点,然后另一个队列通过push_back的方式,实现从左到右的访问。 代码: class Solution { public: vector<vector<int>> l ...
分类:其他好文   时间:2021-04-08 12:59:26    阅读次数:0
10-2 "乞丐"
比较for和while 代码比较复制代码 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 public class HelloWorld { public static void main(String[] args) { //使用while打印0到4 int i =  ...
分类:其他好文   时间:2021-04-08 12:54:22    阅读次数:0
55956条   上一页 1 ... 35 36 37 38 39 ... 5596 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!