A third-grade mathematics question in a Vietnamese primary school

Source: Internet
Author: User

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.

  

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.