czj пре 1 година
родитељ
комит
5a1bee19cb

+ 2 - 0
VS Code/1.cpp

@@ -1,4 +1,6 @@
+//我是个傻逼
 #include <iostream>
+//我是个傻逼
 #include <math.h>
 using namespace std;
 int gcd(int a,int b){

+ 1 - 0
VS Code/2.cpp

@@ -1,3 +1,4 @@
+//我是个傻逼
 #include <bits/stdc++.h>
 using namespace std;
 int main(){

+ 1 - 0
VS Code/3.cpp

@@ -1,3 +1,4 @@
+//我是个傻逼
 #include <bits/stdc++.h>
 using namespace std;
 int encrypt(int m,int e,int n){int c=1;for(int i=0;i<e;i++){c=(c*m)%n;}return c;}

+ 1 - 0
VS Code/Fast Power.cpp

@@ -1,3 +1,4 @@
+//我是个傻逼
 #include <iostream>
 using namespace std;
 int main()

+ 11 - 9
VS Code/fangcheng.cpp

@@ -1,23 +1,25 @@
+//鎴戞槸涓�偦閫�
 #include <iostream>
+//鎴戞槸涓�偦閫�
 #include <math.h>
 using namespace std;
 int main()
 {
     double a,b,c,a2,a21,b1,x1,x2,gdelta,delta1,mum,den,mum1,den1;
     int qu=1,delta,delta2;
-    cout<<"请输入a、b、c"<<endl;
-	cin>>a>>b>>c;//输入系数
+    cout<<"锟斤拷锟斤拷锟斤拷a锟斤拷b锟斤拷c"<<endl;
+	cin>>a>>b>>c;//锟斤拷锟斤拷系锟斤拷
     cout<<a<<"x^2+"<<b<<"x+"<<c<<"=0"<<endl;
 	delta=delta1=(b*b)-(4*a*c); 
     cout<<"delta="<<delta<<endl;
-    if (delta>=0&&(b*b)-(4*a*c)==floor((b*b)-(4*a*c)))//判断Δ是否>=0以及是否是整数
+    if (delta>=0&&(b*b)-(4*a*c)==floor((b*b)-(4*a*c)))//锟叫断︼拷锟角凤拷>=0锟皆硷拷锟角凤拷锟斤拷锟斤拷锟斤拷
     {
         gdelta=sqrt(delta);
-        if (gdelta==floor(gdelta))//判断根号下Δ是否是整数
+        if (gdelta==floor(gdelta))//锟叫断革拷锟斤拷锟铰︼拷锟角凤拷锟斤拷锟斤拷锟斤拷
         {
             x1=(-b+gdelta)/(2*a);
             x2=(-b-gdelta)/(2*a);
-            if (x1==floor(x1)&&x2==floor(x2))//判断解是不是整数
+            if (x1==floor(x1)&&x2==floor(x2))//锟叫断斤拷锟角诧拷锟斤拷锟斤拷锟斤拷
             {
                 cout<<"x1="<<x1<<"\nx2="<<x2<<endl;
             }
@@ -85,7 +87,7 @@ int main()
                         delta2=delta2*i;
                     }
                 }
-            }//开根号
+            }//锟斤拷锟斤拷锟斤拷
             a2=2*a;
             for (int j = 2; j<=fabs(a2)&&j<=fabs(b)&&j<=fabs(qu); j++)
             {
@@ -96,7 +98,7 @@ int main()
                     qu=qu/j;a2=a21;b=b1;
                     j=j-1;
                 }
-            }//化简
+            }//锟斤拷锟斤拷
             cout<<"x1=("<<-b<<"+"<<qu<<"*sqrt("<<delta2<<"))/"<<a2<<"\nx2=("<<-b<<"-"<<qu<<"*sqrt("<<delta2<<"))/"<<a2<<endl;
         }
     }
@@ -107,10 +109,10 @@ int main()
         x1=(-b+gdelta)/(2*a);
         x2=(-b-gdelta)/(2*a);
         cout<<"x1="<<x1<<"\nx2="<<x2<<endl;
-    }//如果Δ是小数的话,暴力求解(本人技术有限)
+    }//锟斤拷锟斤拷锟斤拷锟叫★拷锟斤拷幕锟斤拷锟斤拷锟斤拷锟斤拷锟解(锟斤拷锟剿硷拷锟斤拷锟斤拷锟睫o拷
     else
     {
-        cout<<"方程无实数根"<<endl;
+        cout<<"锟斤拷锟斤拷锟斤拷实锟斤拷锟斤拷"<<endl;
     }
     system("pause");
     return 0;

+ 2 - 0
VS Code/g.cpp

@@ -1,4 +1,6 @@
+//我是个傻逼
 #include <iostream>
+//我是个傻逼
 #include <math.h>
 using namespace std;
 int main(){

+ 2 - 0
VS Code/hanshu.cpp

@@ -1,4 +1,6 @@
+//我是个傻逼
 #include <iostream>
+//我是个傻逼
 #include <math.h>
 using namespace std;
 int main (){

+ 1 - 0
VS Code/hello world.cpp

@@ -1,3 +1,4 @@
+//我是个傻逼
 #include <iostream>
 int main()
 {

+ 1 - 0
VS Code/rsa1.cpp

@@ -1,3 +1,4 @@
+//我是个傻逼
 #include <bits/stdc++.h>
 using namespace std;
 int encrypt(int m,int e,int n){int c=1;for(int i=0;i<e;i++){c=(c*m)%n;}return c;}

+ 1 - 0
VS Code/rsa2.cpp

@@ -1,3 +1,4 @@
+//我是个傻逼
 #include <bits/stdc++.h>
 using namespace std;
 int decode(int c,int d,int n){int m=1;for(int i=0;i<d;i++){m=(m*c)%n;}return m;}

+ 2 - 0
VS Code/sh.cpp

@@ -1,4 +1,6 @@
+//我是个傻逼
 #include <iostream>
+//我是个傻逼
 #include <math.h>
 using namespace std;
 int gcd(int a,int b){

+ 2 - 0
VS Code/wuzi(1)(1).cpp

@@ -1,4 +1,6 @@
+//我是个傻逼
 #include<iostream>
+//我是个傻逼
 #include<math.h>
 using namespace std;
 char a[255];

+ 2 - 0
VS Code/wuzi.cpp

@@ -1,4 +1,6 @@
+//我是个傻逼
 #include <iostream>
+//我是个傻逼
 #include <math.h>
 using namespace std;
 int say(char l[255])

+ 21 - 11
sketch_jan17a.ino

@@ -1,40 +1,50 @@
-void setup() {
+void setup()
+{
   pinMode(2, OUTPUT);
   pinMode(3, OUTPUT);
   pinMode(4, OUTPUT);
   pinMode(5, OUTPUT);
   pinMode(6, INPUT);
+  Serial.begin(9600);
   // put your setup code here, to run once:
-
 }
 int i;
 bool a;
-void loop() {
+void loop()
+{
   digitalWrite(5, HIGH);
-
-  if(digitalRead(6)==HIGH&&a==false){
-    for(i=0;i<10;i++){
+Serial.println(analogRead(0))
+  if (digitalRead(6) == HIGH && a == false)
+  {
+    Serial.println("high")
+    for (i = 0; i < 10; i++)
+    {
       digitalWrite(2, HIGH);
       delayMicroseconds(525);
       digitalWrite(2, LOW);
       delayMicroseconds(19475);
     }
-    a=true;
+    a = true;
     digitalWrite(4, LOW);
     digitalWrite(3, HIGH);
   }
-  else if(digitalRead(6)==HIGH&&a==true){
-    for(i=0;i<10;i++){
+  else if (digitalRead(6) == HIGH && a == true)
+  {
+    Serial.println("high")
+    for (i = 0; i < 10; i++)
+    {
       digitalWrite(2, HIGH);
       delayMicroseconds(900);
       digitalWrite(2, LOW);
       delayMicroseconds(19100);
     }
-    a=false;
+    a = false;
     digitalWrite(4, LOW);
     digitalWrite(3, HIGH);
   }
-  else{
+  else
+  {
+    Serial.println("low")
     digitalWrite(4, LOW);
     digitalWrite(3, LOW);
   }

+ 52 - 0
sketch_jan17a/sketch_jan17a.ino

@@ -0,0 +1,52 @@
+void setup()
+{
+  pinMode(2, OUTPUT);
+  pinMode(3, OUTPUT);
+  pinMode(4, OUTPUT);
+  pinMode(5, OUTPUT);
+  pinMode(6, INPUT);
+  Serial.begin(9600);
+  // put your setup code here, to run once:
+}
+int i;
+bool a;
+void loop()
+{
+  digitalWrite(5, HIGH);
+Serial.println(analogRead(0));
+  if (digitalRead(6) == HIGH && a == false)
+  {
+    Serial.println("high");
+    for (i = 0; i < 10; i++)
+    {
+      digitalWrite(2, HIGH);
+      delayMicroseconds(525);
+      digitalWrite(2, LOW);
+      delayMicroseconds(19475);
+    }
+    a = true;
+    digitalWrite(4, LOW);
+    digitalWrite(3, HIGH);
+  }
+  else if (digitalRead(6) == HIGH && a == true)
+  {
+    Serial.println("high");
+    for (i = 0; i < 10; i++)
+    {
+      digitalWrite(2, HIGH);
+      delayMicroseconds(900);
+      digitalWrite(2, LOW);
+      delayMicroseconds(19100);
+    }
+    a = false;
+    digitalWrite(4, LOW);
+    digitalWrite(3, HIGH);
+  }
+  else
+  {
+    Serial.println("low");
+    digitalWrite(4, LOW);
+    digitalWrite(3, LOW);
+  }
+  // put your main code here, to run repeatedly:
+}