1 solutions
-
0
C :
#include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int x,y,z; for(x=0;x<=20;x++) for(y=0;y<=33;y++) { if(100-x-y==300-15*x-9*y) printf("%d %d %d\n",x,y,100-x-y); } return 0; }C++ :
#include<iostream> using namespace std; int main() { float a,b,c; for (a=0;a<=20;++a) for (b=0;b<=34;++b) for (c=0;c<=100;++c) if ((5*a+3*b+c/3==100)&&(a+b+c==100)) { cout<<a<<" "<<b<<" "<<c; cout<<endl;} return 0; }
- 1
Information
- ID
- 16348
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By