#include "stdio.h"
int main()
{
int a[3][4];
for (int i = 0; i < 3; ++i){
for (int j = 0; j < 4; ++i){
scanf("%d", &a[i][j]);
}
}
int maxi = 0, maxj = 0;
int max = a[0][0];
......................
阅读全部
|
gougoudan
贴于 2020年6月6日 10:50
hide
bbsi
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main()
{srand((unsigned)time(NULL));
int d1,d2,c1,c2,i,j;
c1=0;c2=0;
for(i=1;i<=50;i++)
{d1=0;d2=0;
for(j=1;j<=5;j++)
......................
阅读全部
|
w208152499
贴于 2020年6月5日 13:57
hide
bbsi
#include <iostream>
#include <iomanip>
#include <cstring> // strcpy and strcat prototypes
#include <cstdlib> // exit prototype
using namespace std;
class String
{
friend ostream &operator<<(ostream &, const String &);
friend istream &operator>>(istream &, String &);
public:
String(const char * = ""); // conversion/default constructor
......................
阅读全部
|
gougoudan
贴于 2020年6月3日 14:48
hide
bbsi
#include <iostream>
using namespace std;
class Skill
{
int *nSkill;
public:
Skill(int n) {
nSkill = new int;
*nSkill = n;
cout << "member object " << (*nSkill) <<" constructed" << endl;
}
~Skill(){
......................
阅读全部
|
gougoudan
贴于 2020年6月1日 20:01
hide
bbsi
#include <iostream>
using namespace std;
class Point
{
private:
double x;
double y;
public:
Point(double ix, double iy) :x(ix), y(iy){ cout << "Point Object Constructed." << endl; }
virtual ~Point(){ cout << "Point Object Destructed." << endl; };
virtual void Show() { cout << "x=" << x << ",y=" << y << endl;; }
......................
阅读全部
|
gougoudan
贴于 2020年6月1日 19:48
hide
bbsi
#include <stdio.h>
int main() {
printf("我在编程中国学C语言\n\n");
// 练习一下循环的使用
int i;
for (i=1; i<=20; i++) {
printf("我爱编程中国 %d 次\n", i);
}
printf("\n\n编程中国送我一颗小心心:");
......................
阅读全部
|
HenryYan
贴于 2020年6月1日 16:56
hide
bbsi
package test;
/**
* 测试局部内部类
*/
public class TestLocalInnerClass {
public void show(){
// 作用域仅限于该方法
class Inner{
public void fun(){
System.out.println("helloworld!");
......................
阅读全部
|
youou3
贴于 2020年5月29日 16:27
hide
bbsi
package test;
public class TestWrapperClass {
public static void main(String[] args) {
//基本数据类型转成包装类对象
Integer a = new Integer(3);
Integer b = Integer.valueOf(30);
//把包装类对象转成基本数据类型
int c = b.intValue();
double d = b.doubleValue();
......................
阅读全部
|
youou3
贴于 2020年5月29日 16:26
hide
bbsi
//010E
#include "stdio.h"
#include "stdlib.h"
int find_repeat_number(int arr[], int n)
{
int ret = -1;
if (n > 1){
char* flagArr = (char*)malloc(sizeof(char)* n);
for (int i = n; i--; flagArr[i] = 0);
for (int i = 0; i<n; ++i){
int number = arr[i];
if (flagArr[number]){
......................
阅读全部
|
gougoudan
贴于 2020年5月26日 09:56
hide
bbsi
//013H
#include "stdio.h"
void str_space_replace(const char* src, char* dst)
{
for (char ch; ch = *src; ++src){
if (' ' == ch){
*dst++ = '%';
*dst++ = '2';
*dst++ = '0';
}
else{
......................
阅读全部
|
gougoudan
贴于 2020年5月26日 09:54
hide
bbsi