#!/bin/sh
sum1=0
sum2=0
for x
do
if [ `expr $x % 2` -eq 0 ]
then
sum1=`expr $sum1 + 1`
evenstring="$evenstring$x "
else
sum2=`expr $sum2 + 1`
oddstring="$oddstring$x "
fi
done
echo $sum1 even: $evenstring
echo $sum2 odd: $oddstring
阅读(1032) | 评论(0) | 转发(0) |