Home > Back-end >  Bosses genuflect is begged solve the c subject WA
Bosses genuflect is begged solve the c subject WA

Time:02-06


The source code is as follows:
#include
# define PI 3.1415926
using namespace std;
Int main ()
{
Int T, r1, r2, a1, a2,
Float s;
Do {cin> T; } while (T<=0 | | T> 1 e5);
While (T -)
{
Do {cin> R1. } while (r1 & lt;=0 | | r1 & gt; 1000);
Do {cin> a1; } while (a1 & lt;=0 | | a1 & gt; 360);
Do {cin> R2; } while (r2 & lt;=0 | | r2 & gt; 1000);
Do {cin> A2. } while (a2 & lt;=0 | | a2 & gt; 360);
If (r1 & gt;=r2)
{
If (a1 & lt;=a2) s=PI a1/360 * * (r1 * r1, r2 * r2);
The else s=PI/360 * (a1 * r1 r2 * r1 - a2 * * r2);
}
The else
{
If (a1 & gt; A2) s=0;
The else s=PI/360 * (a1, a2) * * r1, r1
}
Cout}
return 0;
}

CodePudding user response:

Topic request more groups of input and output, made a change, other problems to see comments, for reference:
 # include 
# define PI 3.1415926

using namespace std;

Int main ()
{
Int T, r1, r2, a1, a2, I=0;
Float s [100000];

While (cin> T, T<1 | | T> 1 e5);

While (T -)
{
While (cin> R1, r1 & lt; 1 | | r1 & gt; 1000);
While (cin> A1, a1 & lt; 1 | | a1 & gt; 360);
While (cin> R2, r2 & lt; 1 | | r2 & gt; 1000);
While (cin> A2, a2 & lt; 1 | | a2 & gt; 360);

If (r1 & gt;=r2)
{
If (a1 & lt; [I]=a2) s=PI/360 * a1 * (r1 * r1, r2 * r2);
The else s [I]=PI/360 * (a1 * r1 r2 * r1 - a2 * * r2);
}
The else
{
If (a1 & gt; A2) s [I]=0;
The else s [I]=PI/360 * (a1, a2) * * r1, r1//this is what will appear negative, need to check,
}
//couti++;
}
For (T=0; TCout
System (" pause ");
return 0;
}

//2
//1 2 3 4
//5 6 7 8
//0.0174533
//0.436332
//please press any key to continue..

CodePudding user response:

Text mistakes due to numerical code and pictures is not the same as
Cout format error caused by lack of format control and keep two decimal places
  • Related