[此贴子已经被作者于2020-3-20 14:24编辑过]
#include<stdio.h> int main() { int nBit = 0; int nSum = 0; int ch; while((ch = getchar()) != '\n') { ++nBit; nSum += ch - '0'; } printf("%d %d", nBit, nSum); return 0; }