当前位置:网站首页>【shell】1加到100的方法
【shell】1加到100的方法
2022-06-22 03:50:00 【诗与浪子】
n=1
sum=0
while [ $n -le 100 ]
do
#let sum+=n
#sum=$(($sum+$n))
sum=$[$sum+$n]
#let n++
#n=$(($n+1))
n=$[$n+1]
done
echo $sum
sum=0
for n in {
1..100}
do
let sum+=n
done
echo $sum
边栏推荐
- A solution to the conflict between the keywords of DM data and the fields of the table
- Ora-48132 ora-48170 appears in the alarm log
- How to randomly assign 1000 to 10 numbers
- 【第23天】给定一个长度为 n 的数组,返回删除第 X 位元素后的数组 | 数组删除操作
- IIR滤波器设计基础及Matlab设计示例
- [Niu Ke's questions -sql big factory interview questions] no1 An audio short video
- AI writes its own code to let agents evolve! The big model of openai has the flavor of "human thought"
- Experience and summary of embedded software testing
- Seven thousand word explanation of Alibaba cloud's new generation cloud computing architecture cipu
- Interviewer: do you know the life cycle of flutter?
猜你喜欢

CentOS uses composer install to report an error - phpunitphppunit 8

详细专业的软件功能测试报告应该怎样书写

Solend闹剧背后的「DeFi道德悖论」

Fluent syntax configuration

What are the useful work reporting tools

IIR filter design basis and MATLAB design example

Wechat applet ChAT expression

在线文本按行批量反转工具

It is about one-step creating Yum source cache in Linux

Some journals of C51
随机推荐
其实很多人都在学电子
GDB commissioning, use and sorting
未來已來:雲原生時代
【BP回归预测】基于matlab GA优化BP回归预测(含优化前的对比)【含Matlab源码 1901期】
read stream 特别注意
LeetCode --- 1221. Split a string in balanced strings problem solving Report
Quickly master asp Net authentication framework identity - user registration
Wireshark packet analysis Wireshark 0051 pcap
首個女性向3A手遊要來了?獲IGN認可,《以閃亮之名》能否突出重圍
【写文章神器】标记语言Markdown的使用
Laravel realizes file (picture) uploading
七千字详解阿里云新一代云计算体系架构 CIPU
Multithread interrupt usage
PLC program variable definition and hardware IO Association in Bifu twincat3
Beifu twincat3 ads error query list
[Niu Ke's questions -sql big factory interview questions] no1 An audio short video
Code of ultrasonic rangefinder based on 51 (screenshot version)
云原生架构(02)-什么是云原生
Blazor University (31) form - Validation
基于SSM的博客系统【带后台管理】