test fixes
This commit is contained in:
16
examples/test_code/Example.java
Normal file
16
examples/test_code/Example.java
Normal file
@@ -0,0 +1,16 @@
|
||||
public class Example {
|
||||
private String name;
|
||||
|
||||
public Example(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void greet() {
|
||||
System.out.println("Hello, " + name);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Example example = new Example("Java");
|
||||
example.greet();
|
||||
}
|
||||
}
|
||||
16
examples/test_code/example.c
Normal file
16
examples/test_code/example.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void greet(const char* name) {
|
||||
printf("Hello, %s!\n", name);
|
||||
}
|
||||
|
||||
int add(int a, int b) {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
int main() {
|
||||
greet("C");
|
||||
int result = add(5, 3);
|
||||
printf("5 + 3 = %d\n", result);
|
||||
return 0;
|
||||
}
|
||||
21
examples/test_code/example.cpp
Normal file
21
examples/test_code/example.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
class Person {
|
||||
private:
|
||||
std::string name;
|
||||
int age;
|
||||
|
||||
public:
|
||||
Person(const std::string& name, int age) : name(name), age(age) {}
|
||||
|
||||
void greet() {
|
||||
std::cout << "Hello, I'm " << name << " and I'm " << age << " years old." << std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
int main() {
|
||||
Person person("Alice", 30);
|
||||
person.greet();
|
||||
return 0;
|
||||
}
|
||||
12
examples/test_code/example.go
Normal file
12
examples/test_code/example.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello, World!")
|
||||
greet("Go")
|
||||
}
|
||||
|
||||
func greet(name string) {
|
||||
fmt.Printf("Hello, %s!\n", name)
|
||||
}
|
||||
Reference in New Issue
Block a user