如何在putchar仅帮助下打印整数.我想在不使用外部存储的情况下这样做.
去年在一次采访中提到了这个问题.
考虑一下该计划
#include<stdio.h>
int main()
{
int x = 33;
float y = 5;
printf("%d %d",y,x);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
输出:
0 1075052544
Run Code Online (Sandbox Code Playgroud)
我可以理解y作为UB的0的价值,但yx即将到来?这是一个想法样本.
我正在尝试使用imagemagick为图像添加注释并将其读回来添加注释我能做到
convert -comment "processed" original.jpg converted.jpg
Run Code Online (Sandbox Code Playgroud)
现在输出识别-verbose converted.jpeg
Properties:
comment: processed
date:create: 2017-05-17T12:22:36+06:00
date:modify: 2017-05-17T12:22:36+06:00
exif:ColorSpace: 1
exif:DateTime: 2017:02:04 12:21:36
exif:ExifImageLength: 1273
exif:ExifImageWidth: 900
exif:ExifOffset: 164
exif:Orientation: 1
exif:ResolutionUnit: 2
exif:Software: Adobe Photoshop CS5 Windows
exif:thumbnail:Compression: 6
exif:thumbnail:JPEGInterchangeFormat: 302
exif:thumbnail:JPEGInterchangeFormatLength: 3805
exif:thumbnail:ResolutionUnit: 2
exif:thumbnail:XResolution: 300/1
exif:thumbnail:YResolution: 300/1
Run Code Online (Sandbox Code Playgroud)
是否有更清晰的方式来回读除了以外的评论
identify -verbose converted.jpg | grep 'comment'
Run Code Online (Sandbox Code Playgroud) 在任何类型的服务中,在日志中搜索以下情况的最佳方法是什么:
1 - 如果错误已经发生。
2 - 如果错误被重现并且想要捕获发生的异常/错误。
我知道但效率低下的一些方法是:
tail -f production.log => log flows and you have to check manually.
tail -n1000 production.log => log for last 1000 lines
tail -f production.log | grep '500 Internal Server Error' => shows the flow of log for only one particular line that says 500.
我想打印日志上方的 100 行,以便在这两种情况下也打印回溯(尤其是第二行)。
我给了一个公司的书面报告.我对一个问题有疑问任何人都可以帮助我吗?
以下是最快的排序算法?
a - 冒泡排序
b - shell排序
c - 堆排序
d - 快速排序
我很困惑b/w快速排序和堆排序都有时间复杂度O(nlogn).