Guest User

Untitled

a guest
Jan 6th, 2012
720
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   #!/usr/bin/awk -f
  2.   BEGIN {
  3.     RS="" #将多行记录的分隔符定为一个空行
  4.   }
  5.   {
  6.     sum=0 #定义一个表示总和的变量,初值为0
  7.     for(i=1;i<=NF;i++){ #遍历所有字段
  8.       if((i%2)!=0){ #判断是否为奇数字段
  9.         sum += $i #如果是的话,累加这些字段的值
  10.       }
  11.     }
  12.     print sum,$2 #输出总和,后面跟上对应的网址
  13.   }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×