C语言
qestion_yz_10086
这个作者很懒,什么都没留下…
展开
-
c++读取csv格式文件
c++读取csv格式文件#include <iostream>#include <string>#include <vector>#include <fstream>#include <sstream>using namespace std;int main(){ // 读文件 ifstream inFile("样例.csv", ios::in); string lineStr; ve原创 2020-05-18 15:46:03 · 1523 阅读 · 0 评论 -
c++使用ifstream和ofstream对象读写文件的功能
#include <iostream>#include <cstring> #include<iomanip>#include<fstream>using namespace std;int main() { ifstream infile; ofstream outfile; char name[20]; char str[30]; cout << "请输入文件" << endl; cin >>原创 2020-05-18 11:01:06 · 559 阅读 · 0 评论 -
声明一个公用结构类型变量,并对变量赋值,输入和输出
#include <iostream>#include <cstring> #include<iomanip>using namespace std;struct employess{ int id; char name[20]; char work[20]; union { int classes; char position[10]; }xuanze;};int main() { employess emp[2]; int i原创 2020-05-18 10:44:38 · 183 阅读 · 0 评论 -
C++九九乘法表(小程序)
#include <iostream>#include <cstring> using namespace std;int main(){ int i, j; cout << "九九乘法表" << endl; for (i = 1; i < 10; i++) { for (j = 1; j <= i; j++) { cout << j .原创 2020-05-18 10:27:18 · 222 阅读 · 0 评论 -
C++前自增后自增
C++前自增后自增#include <iostream>#include <cstring> using namespace std;int main() { /**前自增**/ int nLen = 10; int nCount = ++nLen; cout << "nLen=" << nLen << endl; cout << "nCont=" << nCount原创 2020-05-18 10:22:17 · 253 阅读 · 0 评论 -
c++字符串操作
#include <iostream>#include <cstring> using namespace std;int main(){ char str[10]; cout << "请输入少于9个字符" << '\n'; cout << "str="; cin >> str; cout << "通过cout输出字符串" << "\n"; cout .原创 2020-05-18 10:14:54 · 106 阅读 · 0 评论 -
C结构体变量
结构体变量的初始化#include <stdio.h>struct student{ int num; char name[20]; char sex; int age; float score;};int main(){ struct student student1 = { 1001,"liming",'M',20,93.5 }; // * 定义结构体变量...原创 2020-04-09 10:10:53 · 106 阅读 · 2 评论 -
C语言入门小程序
#include <stdio.h>int main(){ int i = 0,j = 0, m = 0; for (i = 1; i <= 9; i++) { for (j = 1; j <= i; j++) { printf("%d*%d=%2d", i, j, i * j); } printf("\n"); } return 0;}...原创 2020-04-03 16:08:37 · 217 阅读 · 0 评论 -
C语言字符型变量特性
C语言字符型变量特性字符数据在内存中存储的是字符的ASCII码,即一个无符号整形数据,其形式与整形数据的存在形式一样,所以C语言允许字符数据与整形数据通用。#include <stdio.h>main(){ char c1, c2; c1 = 'a'; c2 = 'b'; c1 = c1 + 10; c2 = c2 - c1 + 10; printf("%c,%d...原创 2020-03-18 17:15:18 · 470 阅读 · 0 评论