bec666 2019-09-17 22:21 采纳率: 88%
浏览 915
已采纳

为什么#include "iostream" #include "string" #include "algorithm"都不加.h而加上就会出错呢?

#include "iostream"
#include "string"
#include "algorithm"
using namespace std;
bool IsSubstring (string s,string t)
{
    char *it;
    int i;
    int x=s.length();
    it=t.begin();
    for(i=0;i<x;i++)
    {
        it=(find(it,t.end(),s[i]));
        if(it==t.end())
            return false;
    }
    return true;
}
int main()
{
    string s,t;
    while(cin>>s>>t)
    {
        if(IsSubstring(s,t))
            cout<<"yes"<<endl;
        else
            cout<<"no"<<endl;
    }
    return 0;
}
  • 写回答

5条回答 默认 最新

  • qtchen_1988 2019-09-18 10:38
    关注

    简单来说iostream是c++头文件,iostream.h是c头文件。有些编译器不支持iostream.h,你的编译器属于这种

    https://blog.csdn.net/LYKXHTP/article/details/88359043

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn