自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(29)
  • 收藏
  • 关注

原创 vscode配置c/c++

vscode安装c

2022-09-30 11:04:38 315

原创 浙大版《C语言程序设计(第3版)》题目集(函数题)

1int sum( int m, int n );#include <stdio.h>int sum(int m, int n);int main(){ int m, n; scanf("%d %d", &m, &n); printf("sum = %d\n", sum(m, n)); return 0;}int sum(int m,int n){ int sum; for(int i = m;i<=n

2022-03-18 12:05:46 1008

原创 浙大版《C语言程序设计(第3版)》题目集(编程题)

1.输出一个短句“Programming in C is fun!”。#include<stdio.h>int main(void){ printf("Programming in C is fun!"); return 0;}#include<stdio.h>int main(){ int i,j; for( i=0; i<4; i++ ) { for( j=0; j<i; j++)

2022-03-15 17:48:09 488

原创 c语言程序设计-(第四版)第八章

8.3#include<stdio.h>#define N 40int flunk (int n,int people[N]){ int i,counter; for(i=0,counter=0;i<n;i++) { if(people[i]<=60) counter++; } printf("不及格人数为:%d\n",counter);}int main(){ int n;

2022-03-11 17:16:54 187

原创 c语言程序设计-(第四版)第七章

7.2#include<stdio.h>void Count(int a,int b){ int Max; if(a>b){ Max = a; } else{ Max = b; } printf("较大的是%d",Max);}int main(void){ int j,k; printf("输入两个数字:"); scanf("%d,%d",&j,&k); Co

2022-03-07 16:55:54 394

原创 c语言程序设计-(第四版)第六章

6.3#include<stdio.h>main(){ int x=1,find=0; while(!find) { if(x%2==1&&x%3==2&&x%5==4&&x%6==5&&x%7==0) { find=1; } x++; } printf("x=%d\n",x);}6.4#

2022-03-06 17:00:23 647

原创 c语言杂记

猜数字游戏#include<stdio.h>#include <stdlib.h>#include <stdbool.h>#include <time.h>int main(void){ int a,b,c; c = 0; srand(time(NULL));//种子数不同相应a的值不同 a = rand()%100+1; printf("%d",a); while (true){

2022-03-04 11:10:50 2949

原创 c语言程序设计-(第四版)第五章

习题55.1#include <stdio.h>int main(void){ float a; printf("Input a number:"); scanf("%f",&a); if(a>=0) printf("%f",a); else printf("%f",-a);}5.2#include <stdio.h>int main(void){ int a;

2022-03-03 12:14:08 582

原创 github

xxx in:name搜索名称带关键字项目xxx in:description搜描述中带关键词项目xxx in:readme搜readme文件带关键词项目

2022-02-11 21:34:19 154

原创 Java编程思想

psvmsout注释:ctrl+shift+/开头注释:/**+enterpublic class DataOnly { int a ; double b; boolean c; public static void main(String[] args) { DataOnly dataOnly = new DataOnly();//new dataonly.var+enter System.out.println(dataOnly.a

2022-02-10 22:47:49 279

原创 依赖注入2 优势 生命周期

model创建StudentDB类public class StudentDB : IStudentRepository { public Student Add(Student student) { throw new NotImplementedException(); } public Student GetStudent(int id) { Student s

2021-04-04 21:10:50 90

原创 ASP.NET查询的实现

Startup.cs public void ConfigureServices(IServiceCollection services) { services.AddMvc(); } public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) {

2021-04-04 20:19:29 396

原创 依赖注入

Model创建IStudentRepository public interface IStudentRepository//加public,默认私有 { public Student Add(Student student); public Student GetStudent(int id); }StudentRepository下 public class StudentRepository:IStudentRepository//继承 {

2021-04-04 20:19:11 53

原创 ASP.NET打开网页

打开静态文件,打开默认静态文件,打开自己设置的静态文件 public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } //默认打开网页自己设置

2021-04-04 12:19:24 284

原创 ASP.NET Core 中间件 请求处理管道

加载顺序:appsetting.json–》appsetting.envorament.json–》user secret–》环境变量–》command line

2021-04-04 11:24:14 103

原创 c#类设计题

class Worker//设计员工类(Worker)及其子类经理类(Manager),员工类包含私有字段name,salary; //并设置其属性Name,Salary;经理类还有自己的私有成员字段bonus,及其对应属性Bonus; { string name; public string Name { get { return name; } set { name = value; }.

2021-01-02 11:19:44 1617

原创 c#方法题1

回文是指顺读和倒读都一样的字符串。写一个方法,判断一个字符串str1,是否是回文,是回文返回true,否则返回false。例如字符串b是ag7ga是回文,而字符串abc6es就不是回文。要求编写应用程序,来检验方法的正确性。 private static bool huiwen(string s) { bool a; string str = null; for (int i = s.Length - 1; i &gt

2021-01-02 11:19:31 1424 2

原创 c#方法题2

13写一个方法,求分数序列:2/1,1/3,3/4,4/7,7/11,11/18…的前10项之和,并返回。要求编写应用程序,来检验方法的正确性。 public static double SumFei() { double sum = 0; double a = 1; double b = 2; double temp = 0; for (int i = 0; i &lt

2021-01-02 11:19:22 829

原创 c#简单题2

13.求n以内(不包括n)不能同时被2和5整除(能被2或者5整除但不能同时被整除)的所有自然数之和的平方根s,n从键盘输入。Console.WriteLine("请输入n"); int n = int.Parse(Console.ReadLine()); int sum = 0; for(int i=0;i<n;i++) { if(i%2!=0&&i%5!=

2021-01-02 11:19:01 857

原创 c#简单题.1

逆序输出 string s; Console.Write("请输入一个字符串:"); s = Console.ReadLine(); int i = s.Length; for (; i > 0; i--) { Console.Write(s[i - 1]); } Console.

2021-01-02 11:18:44 1709

原创 HTML的JavaScript1

<script language="javascript"> document.write((new Date()).toLocaleDateString()); </script> <script language="javascript"> function Student(sn,name) { this.sn = sn; this.name = name; Student.school = "临沂大学";...

2020-12-29 11:21:24 207 2

原创 HTML的JavaScript2

1.ChangeColor <div id="main"> <br />改变颜色 <div id="div1" onmouseover="changediv()" onmouseout="changedivback()"></div> </div><script> var dt=new Date(); document.getElementById('todaydate').innerHTML=dt.toLocal

2020-12-29 11:21:12 185 1

原创 c#交换数,判断通过考试

static void Swap( ref int x, ref int y) { int temp; temp = x; x = y; y = temp; } int m = 2, n = 3; Console.WriteLine("交换前,两个数{0}和{1}",m,n); Swap(ref .

2020-12-05 18:10:10 83

原创 c#单词个数,加¥,最长单词,平均值

static int count(string sentence) { int count = 0; string[] words = new string[100]; words = sentence.Split(' '); for (int i = 0; i < words.Length; i++) { if (words[i]..

2020-11-28 16:20:26 198

原创 c#猫狗

class //Pet定义一个宠物类(Pet): { string name; //该类中定义私有的成员字段name姓名和age年龄,并设置其相应的公有属性; public string Name { get { return name; } set { name = value; } } int age; public int Age ..

2020-11-24 22:28:40 1836

原创 接口

接口自身可从多个接口继承 public interface Ia //接口Ia声明,接口修饰符可以是new、public、protected、internal和private,接口的命名建议以大写字母I开头 { void mymethod1(); } public interface Ib //接口Ib声明 { int mymethod2(int x); } public interface Ic : Ia, Ib //接口Ic从Ia和I

2020-11-24 21:24:33 198

原创 for循环实现1-100加和,剔除位4尾号

#!/bin/bashi_End=4i_Total=0for((i=1;i<=100;i++))do i_temp=`expr $i % 10` if [ $i_temp -eq $i_End ]; then echo "跳过:${i}" continue; fi i_Total=$((${i_Total}+i))doneecho "Total=${i_Total}"

2020-11-19 16:04:57 200

原创 c#继承和接口设计 多态性

隐藏基类:法1-用新的派生成员替换基成员class A { public void fun() { Console.WriteLine("A"); } } class B : A { **new public void fun() //隐藏基类方法fun** { Conso

2020-11-19 10:46:11 327

原创 c#继承方法的使用

定义一个学生类(Student),有stuName私有字段及相应属性,有Disp方法,显示学生姓名;定义大学生类(CollegeStudent)继承基类Student,有Specialty公有字段和Practice方法,输出学生参与的项目名称;在主函数中实例化一个CollegeStudent的对象,并分别调用基类的方法和自身类的方法。//class Student { string stuName; public string StuName

2020-11-18 22:45:07 896

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除