才考完,没题目,先传代码... #include<stdio.h> #include<string.h> int main() { int flag=0; int a[105]; int tmp[105]; int i=0,k=0; int sum=0; memset(a,0,sizeof(a)); memset(tmp,0,sizeof(tmp)); while(!flag) { scanf("%d",&a[i]); if(a[i]!=0) tmp[k…
import java.util.Scanner; public class Main { public static void main (String[] args) { Scanner scanner=new Scanner(System.in); int score=0; int sum=0; int n=0; while((n=scanner.nextInt())!=0) { if(n==1) { score=1; } else if(n==2&&score%2!=0) { sc…