#include <stdio.h> int i=1; int CompactIntegers(int s[]){ int j; for(i=j=1;s[i]!=EOF;i++) if(s[i]!=0) s[j++]=s[i]; return j-1; } int main(){ int s[1000],a; while(scanf("%d",&s[i])!=EOF) { i++; } a=CompactIntegers(s); printf("%d",a); return 0; }
慕数据5775487
相关分类