我的程序应该要求用户输入他们的信用卡号码,然后显示数字是否有效,如果有效,则显示信用卡类型。我在试图读取cardNumber字符串中的前两个字符时遇到了困难,以确定卡片类型是visa、万事达卡、美国运通还是发现(签证4个,万事达卡5个,美国运通37个,发现6个)
#include <iostream>
#include <string>
using namespace std;
int main()
{
string cardNumber; //this will carry the number given by the user.
int s