A third-grade mathematics question in a Vietnamese primary school
After seeing this news, I felt a little speechless. This question is not so exaggerated. It is also simple to write programs. I hope that the news reported by the media will be like a news report, I hope to report more valuable news about science and technology and the economy. Let's just talk about the code.
#include<iostream>#include<stdlib.h>#include<fstream>#include<time.h>using namespace std;int main(){ fstream outfile; outfile.open("outNum.txt",ios::out); cout<<"beginnig the count"<<endl; time_t begin_time=time(0); tm tim_begin=*localtime(&begin_time); int allofNum=0,num=0; for(int a=1;a<10;a++){ for(int b=1;b<10;b++){ for(int c=1;c<10;c++){ for(int d=1;d<10;d++){ for(int e=1;e<10;e++){ for(int f=1;f<10;f++){ for(int g=1;g<10;g++){ for(int h=1;h<10;h++){ for(int i=1;i<10;i++){ int N[9]={a,b,c,d,e,f,g,h,i}; if(66==a+13*b/c+d+12*e-f-11+g*h/i-10&&(0==b%c)&&(0==g%h)){ outfile<<a<<","<<b<<","<<c<<","<<d<<","<<e<<","<<f<<","<<g<<","<
From the output, we can see that there are a total of 230389 solutions to the above questions. It takes 9 seconds to use the most basic Buddha for loop computation. If there is any error, I hope you can point it out.