用Java做一道小学4年级的数学题

img

public class Main {
  public static void main(String[] args) {
    int a, b, c;
    for (a = 0; a < 400; a++) {
      for (b = 0; b < 400; b++) {
        for (c = 0; c < 400; c++) {
          if (a * 2 == b * 3 && b * 3 == c * 4 && a + b + 2 * c == 400) {
            System.out.println(a);
            System.out.println(b);
            System.out.println(c);
            break;
          }
        }
      }
    }
  }
}

img

#include<stdio.h>
int main()
{
int a;
int b;
int c=1;
while(1)
{
if(2c+c4/3+2c==400)
{
break;
}
else
{
c++;
}
}
printf("○=%d △=%d □=%d",2
c,c*4/3,c);
return 0;
}
这个是c的,改改就行