I also have no language, think not to open where wrong, first put here wait for a period of time not confused and then go to see. or show the master. The error code is attached below
#include <stdio.h>voidLeap ();inta[ $];intMain () {intYear,r,w,e,q,t,i,s,b,d,c; Leap (); scanf ("%d",&t); while(t--) {scanf ("%d%d",&year,&d); if((year%4==0&&year% -!=0)|| year% -==0) R=1; ElseR=0; W=d% the; E=d/ the; C=year/ -; b=year% -; for(i=0;i< Max; i++) { if(a[i+1]>b&&a[i]<b| | a[i]==b) {Q=i; Break; }} s= -* (c+e) +a[w+q-R]; printf ("%d\n", s); } return 0;}voidLeap () {inti,w=0; for(i=0;i< the; i++) { if(i%4==0&&i% -!=0|| i% -==0) {a[w++]=i; } }}
The correct code is attached below
//The idea is simple, but it's also a good idea. But the time complexity is higher. The previous time complexity is lower,//But the comparison is not right, also do not know how.#include <stdio.h>intMain () {intN; scanf ("%d",&N); while(n--) { intA,b,i=0, num; scanf ("%d%d",&a,&b); while(b!=0) {num=a+i; I++; if((num%4==0&&num% -!=0)|| num% -==0) {b--; }} printf ("%d\n", num); } return 0;}
++++++++++++++++++++++++++++++++++++++++++++1076+++++++++++++++++++++++++++++++++++++++++++++++++++