The number in 1-100 that can be divided by 2 and 3

#!/bin/bash
for i in {1..100};do
    a2=$(($i % 2))
    a3=$(($i % 3))
    if test $a2 -eq 0 -a $a3 -eq 0 ;then
        echo "$i能被2和3整除"
    fi
done

Guess you like

Origin blog.51cto.com/12723336/2588368