i=0
for n in range(1,5): #n取1-4的整数小于5
for m in range(1,5):
for k in range(1,5):
if (n!=m) and (m!=k) and (k!=n):
print ("%d%d%d"%(n,m,k)) #不带格式的输出会默认带有一个空格,用格式输出可以去掉空格
i+=1
print(i)
阅读全部
|
sjqfhcx
贴于 2022年12月12日 16:44
hide
bbsi
i=0
for n in range(1,5): #n取1-4的整数小于5
for m in range(1,5):
for k in range(1,5):
if (n!=m) and (m!=k) and (k!=n):
print ("%d%d%d"%(n,m,k)) #不带格式的输出会默认带有一个空格,用格式输出可以去掉空格
i+=1
print(i)
阅读全部
|
sjqfhcx
贴于 2022年12月12日 16:44
hide
bbsi
#include <stdio.h>
#include <iostream>
#include <math.h>
float f(float x, float y, float z) {
float a = x * x + 9.0f / 4.0f * y * y + z * z - 1;
return a * a * a - x * x * z * z * z - 9.0f / 80.0f * y * y * z * z * z;
}
float h(float x, float z) {
for (float y = 1.0f; y >= 0.0f; y -= 0.001f)
if (f(x, y, z) <= 0.0f) {
......................
阅读全部
|
ksz
贴于 2022年12月12日 09:45
hide
bbsi
#include <stdio.h>
#include <iostream>
#include <math.h>
float f(float x, float y, float z) {
float a = x * x + 9.0f / 4.0f * y * y + z * z - 1;
return a * a * a - x * x * z * z * z - 9.0f / 80.0f * y * y * z * z * z;
}
float h(float x, float z) {
for (float y = 1.0f; y >= 0.0f; y -= 0.001f)
if (f(x, y, z) <= 0.0f) {
......................
阅读全部
|
ksz
贴于 2022年12月12日 09:45
hide
bbsi
//esdwd
#include <iostream>
#include <stdio.h>
using namespace std;
////////////////////
int subtrs(int a,int b){
return a-b;
}
class volume{
public:
double width;
......................
阅读全部
|
ksz
贴于 2022年12月11日 21:50
hide
bbsi
#include <stdio.h>
#include <algorithm>
// #include <vector>c
#include <iostream>
using namespace std;
typedef struct student{
char name[20];
int math;
int english;
} Student;
boo cmp(Student a, Student b);
......................
阅读全部
|
sundongnuan
贴于 2022年12月11日 17:15
hide
bbsi
#include <stdio.h>
// #include <algorithm>
// #include <vector>c
// #include <iostream>
// using namespace std;
int main() {
int a[] = {45, 12, 34, 77, 90};
sort(a, a+4, cmp);
for (int i = 0; i < 5; i++) {
cout << a[i] << " ";
......................
阅读全部
|
sundongnuan
贴于 2022年12月11日 16:44
hide
bbsi
#include <stdio.h>
#include <iostream>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <deque>
using namespace std;
class Solution {
public:
int resourceDispatch(const vector<int> &resources, const vector<int> &requests)
{
......................
阅读全部
|
sundongnuan
贴于 2022年12月11日 15:22
hide
bbsi
#include <stdio.h>
#include <iostream>
#include <math.h>
float f(float x, float y, float z) {
float a = x * x + 9.0f / 4.0f * y * y + z * z - 1;
return a * a * a - x * x * z * z * z - 9.0f / 80.0f * y * y * z * z * z;
}
float h(float x, float z) {
for (float y = 1.0f; y >= 0.0f; y -= 0.001f)
if (f(x, y, z) <= 0.0f) {
......................
阅读全部
|
sundongnuan
贴于 2022年12月10日 20:47
hide
bbsi