原题链接
#include <stdio.h> int main(){ int n, count; while(scanf("%d", &n), n){ count = 0; while(n > 2){ count += n / 3; n = n / 3 + n % 3; } if(n == 2) ++count; printf("%d\n", count); } return 0; }
NYOJ662 汽水瓶,布布扣,bubuko.com
NYOJ662 汽水瓶
原文:http://blog.csdn.net/chang_mu/article/details/20731483