This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <math.h> | |
#include <vector> | |
#include <sstream> | |
using namespace std; | |
int main() { | |
char Name[30]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class WonderfulClass | |
{ | |
public: | |
static WonderfulClass* makeAnObject() | |
{ | |
// 创建一个WonderfulClass对象并返回其指针 | |
return (new WonderfulClass); | |
} | |
private: | |
WonderfulClass() { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class CSample { | |
int x; | |
public: | |
CSample() { | |
cout << "Constructor 1 Called" << endl; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Complex { | |
public: | |
double real, imag; | |
Complex( int i ) { //类型转换构造函数 | |
cout << "IntConstructor called" << endl; | |
real = i; imag = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CTyre { //轮胎类 | |
private: | |
int radius; //半径 | |
int width; //宽度 | |
public: | |
CTyre(int r, int w):radius(r), width(w) { } | |
}; | |
class CEngine { //引擎类 | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Complex { | |
public: | |
Complex( double r = 0.0, double i= 0.0 ){ | |
real = r; | |
imaginary = i; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Complex { | |
public: | |
Complex( double r= 0.0, double m = 0.0 ):real(r), imaginary(m) { } // constructor | |
Complex operator+ ( const Complex & ); // addition | |
Complex operator- ( const Complex & ); // subtraction | |
void getValue(){ cout << "real:" << this->real << " imaginary:" << this->imaginary << endl;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create function that finds the number of records and the average weight for each value of the chosen column | |
def get_distinct_values(column_name): | |
sql = """ | |
SELECT | |
{0}, | |
COUNT(1) AS num_babies, | |
AVG(weight_pounds) AS avg_wt | |
FROM | |
publicdata.samples.natality | |
WHERE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# change these to try this notebook out | |
BUCKET = 'cloud-training-demos-ml' | |
PROJECT = 'cloud-training-demos' | |
REGION = 'us-central1' | |
import os | |
os.environ['BUCKET'] = BUCKET | |
os.environ['PROJECT'] = PROJECT | |
os.environ['REGION'] = REGION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
var times [5][0]int | |
for range times { | |
fmt.Println("hello") | |
} |
OlderNewer