lf

实验2

半城伤御伤魂 提交于 2019-12-03 06:41:25
#include <stdio.h> int main () { int x=1234; float f=123.456; double m=123.456; char ch='a'; char a[]="Hello,world!"; int y=3,z=4; printf("%d %d\n",y,z); printf("y=%d,z=%d\n",y,z); printf("%8d,%2d\n",x,x); printf("%f,%8f,%8.1f,%0.2f,%.2e\n",f,f,f,f,f); printf("%lf\n",m); printf("%3c\n",ch); printf("%s\n%15s\n%10.5s\n%2.5s\n%.3s\n",a,a,a,a,a); return 0; } #include <stdio.h> int main() { double x,y; char c1,c2,c3; int a1,a2,a3; scanf("%d%d%d",&a1,&a2,&a3); printf("%d,%d,%d\n",a1,a2,a3); scanf("%c%c%c",&c1,&c2,&c3); printf("%c%c%c\n",c1,c2,c3); scanf("%lf,%lf",&x,&y); printf("%lf,%lf",x,y);

实验二

落爺英雄遲暮 提交于 2019-12-03 06:39:30
Part1: 格式化输出函数printf()和格式化输入函数scanf() #include <stdio.h> #include<stdlib.h> int main() { int x=1234; float f=123.456; double m=123.456; char ch='a'; char a[]="Hello, world!"; int y=3, z=4; printf("%d %d\n", y, z); printf("y=%d, z=%d\n", y,z); printf("%8d,%2d\n", x,x); printf("%f, %8f, %8.1f, %0.2f, %.2e\n",f,f,f,f,f); printf("%lf\n",m); printf("%3c\n", ch); printf("%s\n%15s\n%10.5s\n%2.5s\n%.3s\n",a,a,a,a,a); system("pause"); return 0; } #include <stdio.h> #include<stdlib.h> int main() { double x,y; char c1,c2,c3; int a1,a2,a3; scanf("%d%d%d",&a1,&a2,&a3); printf("%d,%d,%d\n",a1,a2,a3); scanf(

实验二

六眼飞鱼酱① 提交于 2019-12-03 05:44:49
#include<stdio.h> int main() { double x,y; char c1,c2,c3; int a1,a2,a3; scanf("%d%d%d",&a1,&a2,&a3); prinyf("%d,%d,%d\n"a1,a2,a3); scanf("%c%c%c",&c1,&c2,&c3); printf("%c%c%C\n",c1,c2,c3); scanf("%lf,%lf"&x,&y); printf("%f,%lf\n",x,y); return 0; } #include<stdio.h> int main() { double a,b,c; scanf("%lf %lf %lf",&a,&b,&c); if(a<0||b<0||c<0) printf("不能构成三角形\n"); else if (a+b>c&&a+c>b&&b+c>a){ if(a==b&&a==c) printf("构成等边三角形\n"); else if(a==b||a==c||b==c) printf("构成等腰三角形\n"); else printf("构成一般三角形\n"); } else printf("不能构成三角形\n"); return 0; } #indlude<stdio.h> int main() { int x=1234; float f=123

P4525 【模板】自适应辛普森法1

旧城冷巷雨未停 提交于 2019-12-03 05:02:18
P4525 【模板】自适应辛普森法1 1 #include <bits/stdc++.h> 2 using namespace std; 3 const double eps = 1e-6; 4 double a, b, c, d, l, r; 5 inline double f(double x) { 6 return (c*x+d)/(a*x+b); 7 } 8 inline double simpson(double l, double r) { 9 double mid = (l+r)/2; 10 return (f(l)+4*f(mid)+f(r))*(r-l)/6; 11 } 12 inline double asr(double l, double r, double eps, double ans) { 13 double mid = (l+r)/2; 14 double ll = simpson(l,mid), rr = simpson(mid,r); 15 if (fabs(ll+rr-ans) <= 15*eps) return ll+rr+(ll+rr-ans)/15; 16 return asr(l,mid,eps/2,ll)+asr(mid,r,eps/2,rr); 17 } 18 inline double asr(double l, double r

notepad++ 行首行尾添加字符

人走茶凉 提交于 2019-12-03 04:44:52
---恢复内容开始--- 本文链接:https://blog.csdn.net/xf_yan/article/details/91344748 处理SQL 根据别人给的Excel中的某列字段,使用in ('','')条件查询必须要单引号('')及逗号(,)比较麻烦,将Excel中的需要列复制到notpad++,要在行首和行尾添加上需要的字符.利用notepad++进行编辑. $表示行尾,^表示行首. 如上图,就这样.很高效. 如果只是在行尾添加字符,还可以如下操作: 点击 视图->显示符号->显示行尾符勾选后,文件会显示“CR”、“LF” 如果要查找行尾符,Ctrl+F调出查找对话框,在查找目标框输“\r\n”,(CR=\r、LF=\n) 替换模式选“扩展”。 就可在行尾追加东西。 视图->显示符号->显示行尾符勾选后,文件会显示“CR”、“LF” 来源: https://www.cnblogs.com/wyblognew/p/11778145.html

实验二

不问归期 提交于 2019-12-03 02:38:56
/* 《C语言程序设计教程学习指导》p118 实验内容(1) 这是一个常用格式控制符使用示例 运行程序,观察行结果,对照每一行printf()中的格式控制符,理解其功能和用法 */ #include <stdio.h> int main() { int x=1234; float f=123.456; double m=123.456; char ch='a'; char a[]="Hello, world!"; // 定义一个数组a,数组中连续存放了字符串常量hello,world! int y=3, z=4; printf("%d %d\n", y, z); printf("y=%d, z=%d\n", y,z); printf("%8d,%2d\n", x,x); printf("%f, %8f, %8.1f, %0.2f, %.2e\n",f,f,f,f,f); printf("%lf\n",m); printf("%3c\n", ch); printf("%s\n%15s\n%10.5s\n%2.5s\n%.3s\n",a,a,a,a,a); return 0; } // 8d,2d指输出的宽度为8和2,所以输出的1234前有空。 // 至于输出的123.456001这是计算机本身决定的,float型、double型的这种浮点数,在精度上不可能完全精确

Reading in double values with scanf in c

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I try to read-in 2 values using scanf() in C, but the values the system writes into memory are not equal to my entered values. Here is the code: double a,b; printf("--------\n"); //seperate lines scanf("%ld",&a); printf("--------\n"); scanf("%ld",&b); printf("%d %d",a,b); If I enter 1 and 2, CMD returns a correct, but b = -858993460 Here is what I already tried: using float or int instead of double, using scanf_s, using scanf("%d or %f for %i or %li or %lf or %e or %g ), using fflush(stdin) to clear keyboard buffer, reading in b first,

实验二三角形改

无人久伴 提交于 2019-12-03 01:35:59
#include <stdio.h> int main() { double a,b,c; scanf("%lf %lf %lf", &a, &b, &c); if(a<0 || b<0 || c<0) printf("不能构成三角形\n"); else if(a+b>c && a+c>b && b+c>a) { if(a==b || a==c || b==c) { if (a==b && a==c) printf("构成等边三角形\n"); else printf("构成等腰三角形\n"); } else printf("构成一般三角形\n"); } else printf("不能构成三角形\n"); return 0; } 来源: https://www.cnblogs.com/love-elaine/p/11769411.html

实验二part2.1

旧时模样 提交于 2019-12-03 01:32:37
#include <stdio.h> int main() { double a,b,c; scanf("%lf %lf %lf", &a, &b, &c); if(a<0 || b<0 || c<0) printf("不能构成三角形\n"); else if(a+b>c && a+c>b && b+c>a) { if(a==b && a==c) printf("构成等边三角形\n"); else if(a==b || a==c || b==c) printf("构成等腰三角形\n"); else printf("构成一般三角形\n"); } else printf("不能构成三角形\n"); return 0; } 来源: https://www.cnblogs.com/love-elaine/p/11769319.html

git replacing LF with CRLF

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Running git on a Windows XP machine, using bash. I exported my project from SVN, and then cloned a bare repository. I then pasted the export into the bare repositories directory, and did a: git add -A I then got a list of messages saying: LF will be replaced by CRLF What are the ramifications of this conversion? This is a .NET solution in Visual Studio. 回答1: Git has three modes of how it treats line endings: $ git config core.autocrlf # that command will print "true" or "false" or "input" You can set the mode to use by adding an additional