- 博客(9)
- 收藏
- 关注
原创 C++ Daily(4)未完
1. main.cpp #include <iostream> #include "main.h" using namespace std; int main() { student s1("Venus",3.5); student s2("Jon"); student s3=s2; /*cout<<"Student Name: "<<s1.sname <<endl; cout <<"Student GPA: "<<s1.g .
2022-03-26 23:42:09
772
原创 C++ Daily(2)
1. #include <iostream> #define pi 3.14159 using namespace std; int main() { float r=0; cout<<"Please enter the redius"<<endl; while(cin>>r) cout<<2*pi*r<<endl; return 0; } 2. #include ..
2022-03-01 22:32:59
411
原创 C++ Daily(1)
1. #include <iostream> #include<string> #include<limits> #include<conio.h> using namespace std; int main() { string name,gender; int age=0; cout<<"Please enter your name:"<<endl; getline(cin,name); ...
2022-02-25 00:38:42
456
原创 题目非原创
#include<iostream> #include<cstdio> using namespace std; int main() { int N; scanf("%d",&N); for(int a=2;a<=N;++a) for(int b=2;b<a;++b) for(int c=b;c<a;++c) for(int d=c;d<a;++d) .
2022-01-13 10:01:09
188
原创 A simple C program
#include <stdio.h> #include <stdlib.h> int main() { int i,sum=0,m,j; char array[9]; printf("please enter an 8-bit binary number\n"); gets(array);/*Read an 8-bit binary number from the keyboard*/ for(i=0;i<8;i+...
2021-12-05 10:26:13
667
原创 fgets() 简单注意事项
相较于不安全的gets()我们更倾向于使用fgets() 但需注意fgets()自动将string的最后一位赋为'\n' 这就需要我们实行如下操作 fgets(wordChosen, 100, pdictionary); wordChosen[strlen(wordChosen) - 1] = '\0';
2021-12-05 10:21:18
167
1
原创 Some simple C programs
#include<stdio.h>/*include standard library stdio.h for use of and printf()*/ #include<string.h>/*include standard library string.h for use of strlen()and gets() putchar()*/ #include<ctype.h>/*include standard library ctype.h for use of t
2021-11-26 02:30:00
609
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅