当前位置:网站首页>Group programming TIANTI competition exercise - continuously updating
Group programming TIANTI competition exercise - continuously updating
2022-06-28 19:16:00 【Yunxi my goddess】
1、L1-003 Single digit statistics fraction 15

Input format :
Each input contains 1 Test cases , I.e. no more than one 1000 Bit positive integer N.
Output format :
Yes N Each different digit in , With D:M Output the digit in one line D And in N Is the number of times M. Required press D Ascending output of .
Examples :
100311
0:2
1:3
3:1
AC Code :
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
char N[1005];
scanf("%s",N);
int num[10]={
0};
for(int i=0;i<10;i++)
{
for(unsigned j=0;j<strlen(N);j++)
{
if((N[j]-48)==i)// Convert characters to numbers
{
num[i]++;
}
}
}
for(int i=0;i<10;i++)
{
if(num[i]!=0)
{
printf("%d:%d\n",i,num[i]);
}
}
return 0;
}
1、L1-005 Test seat number fraction 15
Every PAT Candidates are assigned two seat numbers when they take the exam , One is a test seat , One is the exam seat . Under normal circumstances , Candidates will get the seat number of the test machine before entering , After entering the test state , The system will display the test seat number of the candidate , Candidates need to change their seats during the examination . But some candidates are late , The test run is over , They can only ask you for help with the number of the test seat they have received , Find out their test seat number from the background .
Input format :
The first line of input gives a positive integer N(≤1000), And then N That's ok , Each line gives a candidate's information : Ticket number Test seat number Test seat number . Among them, the examination Permit No. is issued by 16 Digit composition , Seat from 1 To N Number . Input to make sure that everyone's admission number is different , And at no time will two people be assigned to the same seat .
After candidate information , Give a positive integer M(≤N), In the next line M Test seat numbers to be inquired , Space off .
Output format :
Corresponding to each seat number to be inquired , Output the candidate's pass number and seat number in one line , Intermediate use 1 Space separation .
Examples :
4
3310120150912233 2 4
3310120150912119 4 1
3310120150912126 1 3
3310120150912002 3 2
2
3 4
3310120150912002 2
3310120150912119 1
AC Code :
#include<iostream>
#include<cstring>
using namespace std;
// Use structures to store information
struct Node
{
char id[18];// Ticket number
int sj;// Test seat number
int ks;// Test seat number
};
int main()
{
int N;
scanf("%d",&N);
struct Node node[N];// Define an array of structures , Use struct
char id[18];
int sj,ks;
// Enter and save data
for(int i=0;i<N;i++)
{
scanf("%s%d%d",id,&sj,&ks);
strcpy(node[i].id,id);
node[i].sj=sj;
node[i].ks=ks;
}
int M;
scanf("%d",&M);
// Query sequentially
for(int i=0;i<M;i++)
{
int k=0;
scanf("%d",&k);
for(int j=0;j<N;j++)
{
if(node[j].sj==k)
{
printf("%s %d\n",node[j].id,node[j].ks);
}
}
}
return 0;
}
1、L1-007 Read numbers fraction 10
Enter an integer , Output the Pinyin corresponding to each number . When the integer is negative , First, the output fu word . The Pinyin corresponding to ten numbers is as follows :
0: ling
1: yi
2: er
3: san
4: si
5: wu
6: liu
7: qi
8: ba
9: jiu
Input format :
Input gives an integer on a line , Such as :1234.
Tips : Integers include negative numbers 、 Zero and positive .
Output format :
Output the Pinyin corresponding to the integer in one line , The Pinyin of each number is separated by a space , There is no final space at the end of the line . Such as
yi er san si.
Examples :
-600
fu liu ling ling
AC Code :
#include<iostream>
#include<string>
using namespace std;
#include<stack>
int main()
{
string arr[10]={
"ling","yi","er","san","si","wu","liu","qi","ba","jiu"};
int n;
scanf("%d",&n);
if(n<0)
{
printf("%s ","fu");
}
stack<int>s;
int N=abs(n);// Take the absolute value
if(N==0)//0 A special sentence is required
{
cout<<"ling";
}
// Get your numbers , And use the stack to store
while(N)
{
int num=N%10;
N/=10;
s.push(num);
}
while(!s.empty())
{
int k=s.top();// Get stack top element
// The last one is to judge , There are no spaces
if(s.size()==1)
{
cout<<arr[k];
}else
{
cout<<arr[k]<<" ";
}
s.pop();// Delete stack top element
}
return 0;
}
1、L1-008 Sum of integral segments fraction 10
Given two integers A and B, Output from A To B All the integers of and the sum of these numbers .
Input format :
Enter... On one line 2 It's an integer A and B, among −100≤A≤B≤100, Separated by spaces .
Output format :
First, output sequentially from A To B All integers of , Every time 5 A line of numbers , Each number accounts for 5 Character width , Align right . Finally, in a line, press Sum = X Output the sum of all the numbers X.
Examples :
-3 8
-3 -2 -1 0 1
2 3 4 5 6
7 8
Sum = 30
AC Code :
#include<iostream>
int main()
{
int a,b;
scanf("%d%d",&a,&b);
int sum=0,cnt=0;
for(int i=a;i<=b;i++)
{
printf("%5d",i);// %md To the right , The character width is m
cnt++;
if(cnt%5==0&&b-a!=4)// b-a!=4 Prevent only 5 A situation where a line breaks when a number is added
{
printf("\n");
}
sum+=i;
}
printf("\nSum = %d",sum);// Notice the spaces
return 0;
}
1、L1-009 N Sum the numbers fraction 20
The requirement of this question is very simple , Is o N A number and . The trouble is , These numbers are expressed as rational numbers / Given in the form of denominator , The sum you output must also be in the form of a rational number .
Input format :
The first line of input gives a positive integer N(≤100). The next line is formatted a1/b1 a2/b2 … give N Rational number . Make sure that all molecules and denominators are in the range of long integers . in addition , The sign of a negative number must be in front of the molecule .
Output format :
Output the simplest form of the sum of the above numbers —— Write the result as an integer Fraction part , The fraction is written as a molecule / The denominator , The numerator is required to be smaller than the denominator , And they don't have a common factor . If the integral part of the result is 0, Only the fraction part is output .
Examples :
// Examples 1
5
2/5 4/15 1/30 -2/60 8/3
3 1/3
// Examples 2
2
4/3 2/3
2
// Examples 3
3
1/3 -1/6 1/8
7/24
AC Code :
#include<iostream>
// Find the greatest common divisor of the numerator and denominator
int gcd(int a,int b)
{
if(b==0)return a;
else return gcd(b,a%b);
}
// Use a structure to store scores
struct Frac
{
long long up,down;// Molecular denominator
Frac(){
}
Frac(long long u,long long d)
{
up=u,down=d;
}
};
// The simplification of fractions
Frac redu(Frac res)
{
// If the denominator is negative , To correct the denominator , Molecules become negative
if(res.down<0)
{
res.up=-res.up;
res.down=-res.down;
}
// The score is 0 Words , Let the molecule be 0, The denominator is 1
if(res.up==0)
{
res.down=1;
}else
{
// And divide by the greatest common divisor , Simplify fractions
int d=gcd(abs(res.up),res.down);
res.up/=d;
res.down/=d;
}
return res;
}
// Output score
void showResult(Frac r)
{
r=redu(r);// Simplify first
// If it's an integer , Direct output
if(r.down==1)printf("%lld\n",r.up);// %lld Output long integer
else if(abs(r.up)>r.down)// If it is a false score
{
// Output the integer part first , Then output the rest
printf("%lld %lld/%lld\n",r.up/r.down,abs(r.up)%r.down,r.down);
}else{
printf("%lld/%lld\n",r.up,r.down);
}
}
// The addition of fractions , Applies to negative fractions
Frac add(Frac f1,Frac f2)
{
Frac res;
res.up=f1.up*f2.down+f1.down*f2.up;
res.down=f1.down*f2.down;
return redu(res);
}
int main()
{
int N;
scanf("%d",&N);
struct Frac arr[N];// Create a structure array to store the scores
for(int i=0;i<N;i++)
{
scanf("%lld/%lld",&arr[i].up,&arr[i].down);
}
Frac res(0,1);// Store results
for(int i=0;i<N;i++)
{
res=add(res,arr[i]);// Cumulative sum
}
showResult(res);
return 0;
}
1、L1-010 Compare the size fraction 10
This question requires any input 3 Integers output from small to large .
Input format :
Enter... On one line 3 It's an integer , Separated by spaces .
Output format :
In one line 3 Integers output from small to large , In the meantime “->” Connected to a .
Examples :
4 2 8
2->4->8
AC Code :
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int arr[3];
for(int i=0;i<3;i++)
{
scanf("%d",&arr[i]);
}
sort(arr,arr+3);// Sort directly into the array
printf("%d->%d->%d",arr[0],arr[1],arr[2]);
return 0;
}
L1-011 A-B fraction 20
This problem requires you to calculate A−B. But the trouble is ,A and B All strings —— That is, from the string A Put the string in B Delete all the included characters , The rest of the characters are strings A−B.
Input format :
Enter in 2 The string is given one after the other A and B. Neither string is longer than 10
4
, And make sure that every string is made visible ASCII Code and white space characters , End with a line break .
Output format :
Print out... On one line A−B The result string of .
Examples :
I love GPLT! It's a fun game!
aeiou
I lv GPLT! It's fn gm!
AC Code :
edition 1
Mark output method
#include<iostream>
using namespace std;
#include<cstring>
const int n=10010;
int main()
{
char a[n],b[n];
// Read character array
cin.getline(a,sizeof(a));
cin.getline(b,sizeof(b));
// Only use strlen(), Will not contain the... At the end of the string '\0'
for(unsigned i=0;i<strlen(a);i++)
{
bool flag=true;// Mark whether to output
for(unsigned j=0;j<strlen(b);j++)
{
if(a[i]==b[j])
{
flag=false;// There is , No output
break;
}
}
if(flag)
{
printf("%c",a[i]);
}
}
return 0;
}
edition 2
String built-in function method
#include<iostream>
using namespace std;
#include<string>
int main()
{
string a,b;
// Read a line of string
getline(cin,a);
getline(cin,b);
int pos;
// The length of the string is in length() Method to get
for(unsigned i=0;i<b.length();i++)
{
while((pos=a.find(b[i]))!=-1)
{
a.erase(pos,1);// Delete pos The character of position
}
}
cout<<a;
return 0;
}
(1)erase(pos,n); Remove from pos At the beginning n Characters , such as erase(0,1) Is to delete the first character
(2)erase(position); Delete position One character at (position It's a string Iterator of type )
(3)erase(first,last); Remove from first To last Characters between (first and last They're all iterators )
L1-012 Calculate the index fraction 5
I really didn't lie to you , This is a simple question —— No more than for any given 10 The positive integer n, You are required to output 2 ^n.
Input format :
The input gives no more than 10 The positive integer n.
Output format :
Format in one line 2^n = The result of the calculation is Output 2 ^n Value .
Examples :
5
2^5 = 32
AC Code :
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int n;
scanf("%d",&n);
double ans=pow(2.0,n);// Use built-in functions to calculate powers , The return is double type
printf("2^%d = %.f",n,ans);
return 0;
}
L1-013 Calculate factorial sum fraction 10
For a given positive integer N, You need to calculate S=1!+2!+3!+…+N!.
Input format :
The input gives no more than 10 The positive integer N.
Output format :
Output in one line S Value .
Examples :
3
9
AC Code :
#include<iostream>
// Recursively factoring
long long fact(int n)
{
if(n==1)return 1;
else return n*fact(n-1);
}
// Sum of factorials
long long getSum(int n)
{
long long sum=0;
while(n)
{
sum+=fact(n);
n--;
}
return sum;
}
int main()
{
int n;
scanf("%d",&n);
printf("%lld",getSum(n));
return 0;
}
L1-016 Check your ID card fraction 15
A legal ID number is from 17 Location 、 Date number and sequence number plus 1 Bit check code composition . Check code calculation rules are as follows :
First of all, to the front 17 Bit number weighted sum , The weight is assigned to :{7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2}; Then the sum of the calculated values is compared to the 11 Take the modulus to get the value Z; Finally, according to the following relationship Z Value and check code M Value :
Z:0 1 2 3 4 5 6 7 8 9 10
M:1 0 X 9 8 7 6 5 4 3 2
Now give me some ID number. , Please verify the validity of the check code , And output the problem number .
Input format :
Enter the first line to give a positive integer N(≤100) The number of the ID number entered. . And then N That's ok , Each line gives 1 individual 18 I. D. number .
Output format :
Output each line in the order of input 1 Question Id number . This is not before the test 17 Is it reasonable , Just before checking 17 Are all digits and last 1 Accurate calculation of bit check code . If all the numbers are OK , The output All passed.
Examples :
4
320124198808240056
12010X198901011234
110108196711301866
37070419881216001X
12010X198901011234
110108196711301866
37070419881216001X
2
320124198808240056
110108196711301862
All passed
AC Code :
#include<iostream>
using namespace std;
const int qz[17]={
7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};// The weight
const char m[11]={
'1','0','X','9','8','7','6','5','4','3','2'};// Check code M
// Verify whether the check code is correct
bool jiaoyan(char id[])
{
int z=0,sum=0;
for(int i=0;i<17;i++)
{
sum+=(id[i]-'0')*qz[i];//char First convert to int Calculate again
}
z=sum%11;
return m[z]==id[17];// Abbreviation
/* if(m[z]==id[17]) { return true; }else { return false; } */
}
bool judge(char id[])
{
for(int i=0;i<17;i++)
{
if(!isdigit(id[i]))// front 17 Bits have a direct that is not a number false
{
return false;
break;
}
}
return true;
}
int main()
{
int N;
scanf("%d",&N);
char id[20];
int cnt=0;
while(N--)
{
scanf("%s",id);
bool flag=false;
if(jiaoyan(id)&&judge(id))
{
flag=true;
}
if(!flag)
{
cnt++;
cout<<id<<endl;
}
}
if(cnt==0)//cnt still 0 Explain that there is no mistake
{
cout<<"All passed"<<endl;
}
return 0;
}
L1-017 How many fraction 15
An integer “ The degree of a second offense ” Defined as contained in the number 2 The ratio of the number of bits to the number of bits . If this number is negative , The degree increases 0.5 times ; If it's still an even number , Is to add 1 times . For example, digital -13142223336 It's a 11 digit , Among them is 3 individual 2, And it's negative , And even , Then the second degree of its offense is calculated as :3/11×1.5×2×100%, about 81.82%. In this case, you calculate how many dimes a given integer has .
Input format :
The first line of input gives no more than one 50 An integer N.
Output format :
Output in one line N The degree of a second offense , Keep two decimal places .
Examples :
-13142223336
81.82%
AC Code :
#include<iostream>
#include<cstring>
using namespace std;
double judge(char N[],int len)
{
int isFu= N[0]=='-' ? 1:0;
char c=N[len-1];
int oushu= ((c=='0')||(c=='2')||(c=='4')||(c=='6')||(c=='8')) ? 1:0;
int count=0;
for(int i=0;i<len;i++)
{
if(N[i]=='2')count++;
}
int cnt= N[0]=='-' ? len-1:len;// If it's negative , The number of digits should be reduced by one
double ans=((double)(count)/cnt)*(1+(0.5)*isFu)*(1+1*oushu);
return ans;
}
int main()
{
char N[55];
scanf("%s",N);
int len=strlen(N);
if(N[0]==0)
{
printf("0");
}else
{
printf("%.2f%%",judge(N,len)*100);// The output percentage sign should be preceded by %
}
return 0;
}
L1-018 Big Ben fraction 10
There is a claim on weibo “ Big Ben V” The guy who , Bells are rung every day to urge the farmers to take good care of their health and go to bed early . But since Ben doesn't work and rest regularly on his own , So the ringing of the bell is irregular . Generally, the number of striking bells is determined by the striking time , If I happen to knock on the hour , that “ When ” It's going to be equal to that integral ; If it's past the hour , I'm just going to knock on the next one . in addition , Although one day 24 Hours , The clock struck only the second half of the day 1~12 Next . For example, in 23:00 bell , Namely “ Dang dang dang dang dang dang dang dang dang dang dang dang ”, And by the 23:01 It would be “ Dangdang dangdang dangdang dangdang ”. In the middle of the night 00:00 Until noon 12:00 period ( Endpoint time is included ), Stupid clocks don't strike .
Now write a program , Ring Big Ben according to the current time .
Input format :
Enter the first line as follows hh:mm Gives the current time . among hh Is the hour , stay 00 To 23 Between ;mm Is a minute , stay 00 To 59 Between .
Output format :
Ring Big Ben according to the current time , That is, the corresponding number of output in a line Dang. If it's not the bell-ringing period , The output :
Only hh:mm. Too early to Dang.
Examples :
19:05
DangDangDangDangDangDangDangDang
07:05
Only 07:05. Too early to Dang.// Two spaces
AC Code :
#include<iostream>
using namespace std;
int main()
{
int h,m;
scanf("%d:%d",&h,&m);
int flag= m==0 ? 0:1;// Minutes are not 0 Just hit the next point
int cnt;// Record the number of strokes
if(h<=12)
{
printf("Only %02d:%02d. Too early to Dang.",h,m);// Notice that there are two spaces
}else{
cnt=h-12+flag;// Count times
for(int i=1;i<=cnt;i++)
{
printf("Dang");
}
}
return 0;
}
L1-019 Who first down fraction 15
Boxing is an interesting part of the ancient Chinese wine culture . The method of two people on the wine table is : Shout out a number from each mouth , Draw a number with your hand . If someone's number is exactly equal to the sum of the two Numbers , Who is lost , The loser gets a glass of wine . Either a win or a loss goes on to the next round , Until the only winner comes along .
So let's give you a 、 B how much for two ( How many cups can you drink at most ) And punching records , Please judge which of the two should go first .
Input format :
The first line of input gives us a 、 B how much for two ( No more than 100 Non-negative integer ), Space off . The next line gives a positive integer N(≤100), And then N That's ok , Each line gives a record of one stroke , The format is :
A shout A stroke Ethyl shout B row
Among them, shouting is the number , A stroke is a number drawn out , No more than 100 The positive integer ( Row with both hands ).
Output format :
Output the first person to fall on the first line :A On behalf of a ,B On behalf of the b . The second line shows how many drinks the person who didn't pour had . They guarantee that one person will fall . Note that the program terminates when someone drops , You don't have to deal with the rest of the data .
sample input :
1 1
6
8 10 9 12
5 10 5 10
3 8 5 12
12 18 1 13
4 16 12 15
15 1 1 16
A
1
AC Code :
#include<iostream>
using namespace std;
int main()
{
int A,B;
scanf("%d%d",&A,&B);
int N;
scanf("%d",&N);
int a,b,c,d;
int cntA=0,cntB=0;// Number of drinks
while(N--)
{
scanf("%d%d%d%d",&a,&b,&c,&d);
cntA+= a+c==b&&b!=d ? 1:0;// Win without drinking
cntB+= a+c==d&&b!=d ? 1:0;
if(cntA>A)
{
printf("A\n%d",cntB);
break;// When one side falls, it stops
}else if(cntB>B)
{
printf("B\n%d",cntA);
break;
}
}
return 0;
}
L1-021 Say the important thing three times fraction 5
This super simple problem doesn't have any input .
All you have to do is say this very important sentence —— “I’m gonna WIN!”—— Output three times in a row .
Notice that each row is occupied , You cannot have any extra characters except for the carriage return on each line .
I'm gonna WIN!
I'm gonna WIN!
I'm gonna WIN!
for i in range(3):% Generate 0、1、2 Three times
print("I'm gonna WIN!")
L1-022 Parity separation fraction 10
Given N A positive integer , Please count the number of odd and even Numbers ?
Input format :
The first line of input gives us a positive integer N(≤1000); The first 2 Line is given N Nonnegative integers , Space off .
Output format :
Output the number of odd Numbers successively in a line 、 Number of even Numbers . In the middle to 1 Space separation .
Examples :
9
88 74 101 26 15 0 34 22 77
3 6
AC Code :
import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int n=in.nextInt();
int cntA=0,cntB=0;
// Enter one to judge one
for(int i=0;i<n;i++)
{
int num=in.nextInt();
if(num%2==0)
{
cntA++;
}else
{
cntB++;
}
}
System.out.printf("%d %d",cntB,cntA);
}
}
L1-023 Output GPLT fraction 20
A given length does not exceed 10000 Of 、 A string consisting only of English letters . Please reorder the characters , Press GPLTGPLT… Output in this order , And ignore the other characters . Of course , Four types of characters ( Case insensitive ) It doesn't have to be the same number , If a character has been printed out , Then press the remaining characters GPLT Sequential printing , Until all characters are printed .
Input format :
The input is given in a line with a length not exceeding 10000 Of 、 A non - empty string consisting only of English letters .
Output format :
Output the sorted string on a line by the title . The question guarantees that the output is not empty .
Examples :
pcTclnGloRgLrtLhgljkLhGFauPewSKgt
GPLTGPLTGLTGLGLL
AC Code :
#include<iostream>
using namespace std;
#include<cstring>
int main()
{
char arr[10010];
cin.getline(arr,sizeof(arr));
int g=0,p=0,l=0,t=0;
for(unsigned i=0;i<strlen(arr);i++)
{
switch((char)arr[i])// The character is automatically converted to int, So turn back
{
case 'G':
case 'g':
g++;
break;
case 'P':
case 'p':
p++;
break;
case 'L':
case 'l':
l++;
break;
case 'T':
case 't':
t++;
break;
}
}
while(1)
{
if(g)
{
cout<<"G";
g--;
}
if(p)
{
cout<<"P";
p--;
}
if(l)
{
cout<<"L";
l--;
}
if(t)
{
cout<<"T";
t--;
}
if(g==0&&p==0&&l==0&&t==0)break;
}
return 0;
}
L1-024 The day after tomorrow fraction 5
If today is Wednesday , The day after tomorrow is Friday ; If today is Saturday , The day after tomorrow is Monday . We use Numbers 1 To 7 Monday to Sunday . Given a day , Please export that day “ The day after tomorrow ” What day is .
Input format :
The first line of input gives a positive integer D(1 ≤ D ≤ 7), Represents a day of the week .
Output format :
Output in one line D What day is the day after tomorrow .
Examples :
5
7
AC Code :
#include<iostream>
using namespace std;
int main()
{
int D;
cin>>D;
if(D<=5)
{
cout<<(D+2);
}else if(D==6)
{
cout<<1;
}else if(D==7)
{
cout<<2;
}
return 0;
}
L1-026 I Love GPLT fraction 5
This super simple problem doesn't have any input .
All you have to do is say this very important sentence —— “I Love GPLT”—— Vertical output is OK .
So-called “ Vertical output ”, It's one line per character ( Including Spaces ), That is, each line can only have 1 Two characters and carriage return .
I
L
o
v
e
G
P
L
T
AC Code :
public class Main
{
public static void main(String args[])
{
String s="I Love GPLT";
for(int i=0;i<s.length();i++)
{
System.out.println(s.charAt(i));
}
}
}
L1-028 Judgement primes fraction 10
The goal of this question is very simple , Is to determine whether a given positive integer is a prime number .
Input format :
Enter a positive integer on the first line N(≤ 10), And then N That's ok , Each line gives a less than 2
31
A positive integer that needs to be judged .
Output format :
For each positive integer to be judged , If it's a prime , Output in one line Yes, Otherwise output No.
Examples :
2
11
111
Yes
No
import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int n=in.nextInt();
for(int i=0;i<n;i++)
{
int num=in.nextInt();
if(isPrime(num))
{
System.out.println("Yes");
}else
{
System.out.println("No");
}
}
}
public static boolean isPrime(int num)
{
if(num==1)return false;//1 A special sentence is required
int temp=(int)Math.sqrt(num);//sqrt Get is double
for(int i=2;i<=temp;i++)
{
if(num%i==0)
{
return false;
}
}
return true;
}
}
L1-029 Is it too fat fraction 5
It is said that a person's standard weight should be his height ( Company : centimeter ) subtract 100、 Multiplied by 0.9 The kilogram obtained . It is known that the value of the market weight is twice that of the kilogram . Now give someone height , Please calculate the standard weight ?( By the way, I'll calculate it for myself ……)
Input format :
The first line of input gives a positive integer H(100 < H ≤ 300), For someone's height .
Output format :
Output the corresponding standard weight in one line , Unit: market Jin , After decimal point 1 position .
Examples :
169
124.2
#include<iostream>
int main()
{
int n=0;
scanf("%d",&n);
double w=2*(n-100)*0.9;
printf("%.1f",w);
return 0;
}
边栏推荐
猜你喜欢

Anonymous function variable problem

智能计算系统3 Plugin 集成开发的demo

High performance and high availability computing architecture scheme commented by Weibo

About Statistical Distributions

How to resolve kernel errors? Solution to kernel error of win11 system

3D可旋转粒子矩阵

try except 添加辅助新列

SQL Server2019 新建 SQL Server身份验证用户名 并登录

论文笔记:Universal Value Function Approximators

视频压缩处理之ffmpeg用法
随机推荐
F(x)构建方程 ,梯度下降求偏导,损失函数确定偏导调整,激活函数处理非线性问题
Mybayis之核心主件分析
use. NETCORE's own background job, which simply simulates producers and consumers' processing of request response data in and out of the queue
Baidu time factor addition
C# 41. int与string互转
Anonymous function this pointing and variable promotion
怎样去除DataFrame字段列名
Shell script batch modify file directory permissions
[C #] explain the difference between value type and reference type
Question brushing analysis tool
[unity3d] emission (raycast) physical ray (Ray)
在arm版本rk3399中搭建halo博客
Michael Wooldridge, professeur à l'Université d'Oxford: comment la communauté de l'IA voit les réseaux neuronaux depuis près de 40 ans
Idea merge other branches into dev branch
从设计交付到开发,轻松畅快高效率!
matlab 二维或三维三角剖分
PostgreSQL database docker
OpenHarmony—内核对象事件之源码详解
math_ Proving common equivalent infinitesimal & Case & substitution
列表加入计时器(正计时、倒计时)