#include<stdio.h> int main() { long nc; nc = 0; while(getchar() != '0') { ++nc; } printf("%ld\n", nc); } 很简答的程序