1.下载gitbash
2.gitee/github创建仓库
3.打开gitbash窗口
4.按照gitee指示键入命令
效果:
gitbas常用命令行
http://t.csdn.cn/8Gb9j (3条消息) git pull 报错:error: Pulling is not possible because you have unmerged files._fix them up in the work tree, and then use 'git ad_sylvia_0815的博客-CSDN博客
完整代码
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
void read_text(FILE *fp)
{
char line[1024] = {0};
rewind(fp); // 重置指针
while (1)
{
// 文件读取结束
if (EOF == fscanf(fp, "%s", line))
break;
printf("%s\n", line);
}
}
int main(int argc, char *argv[])
{
FILE *fPtr;
int c; // int 读取单个字符
int n = 0;
// printf("%d\n", argc, n);
printf("---------------------------\n");
printf("code: %s\n", argv[0]); // wordcount
printf("mode: %s\n", argv[1]); //-c/w
printf("name: %s\n", argv[2]); // input file
fPtr = fopen(argv[2], "r");
if (fPtr == NULL)
{
printf("can't open\n");
}
else
{
if (argv[1][1] == 'c')
{ // 读字符
while (c != EOF)
{
c = fgetc(fPtr);
n++;
// printf("%d %c %d\n", n, c, c);
// EOF=-1
}
printf("n: %d\n", n - 1);
}
else if (argv[1][1] == 'w')
{ // 读单词
int start = 0, end = 0;
while (c != EOF)
{
c = fgetc(fPtr);
// if (c == 32) //" "
// printf("space");
if (!(c == ' ' || c == ',' || c == '.' || c == '!'))
{
start = 1; // 单词开始
// printf("%c s:%d e:%d\n", c, start, end);
}
//" "
else if (c == ' ' || c == ',' || c == '.' || c == '!' || c == '\n')
{
if (start)
{
end = 1; // 单词结束
}
// printf("%c s:%d e:%d\n", c, start, end);
}
if (start && end)
{
n++;
start = end = 0;
}
}
printf("n: %d\n", n);
}
printf("---------------------------\nfile content:\n");
read_text(fPtr);
}
printf("---------------------------\n");
fclose(fPtr);
return 0;
}